saveMany method
Future<List<T> >
saveMany({
- required List<
T> items, - required String userId,
- bool andSync = false,
- DataSource source = DataSource.local,
- bool forceRemoteSync = false,
- DatumSyncOptions<
T> ? syncOptions, - DatumSyncScope? scope,
Implementation
Future<List<T>> saveMany({
required List<T> items,
required String userId,
bool andSync = false,
DataSource source = DataSource.local,
bool forceRemoteSync = false,
DatumSyncOptions<T>? syncOptions,
DatumSyncScope? scope,
}) async {
_ensureInitialized();
final savedItems = <T>[];
for (final item in items) {
final savedItem = await push(item: item, userId: userId, source: source, forceRemoteSync: forceRemoteSync);
savedItems.add(savedItem);
}
if (andSync) {
await synchronize(userId, options: syncOptions, scope: scope);
}
return savedItems;
}