insertList method

  1. @override
Future<List<TEntity>?> insertList(
  1. Iterable<TEntity> items, {
  2. bool? useIsolate,
})

Implementation

@override
Future<List<TEntity>?> insertList(
  Iterable<TEntity> items, {
  final bool? useIsolate,
}) async {
  List<TEntity> result = [];
  for (var item in items) {
    if (item.id == null) {
      item = item.copyWith(id: const Uuid().v4()) as TEntity;
    }
    item = await _saveItem(item, true);
    result.add(item);
  }
  return result;
}