createLocalDocs method

  1. @protected
List<T> createLocalDocs({
  1. required List<CreateDocDef<T>> docs,
  2. bool doNotifyListeners = true,
})

Creates multiple new documents in local state.

Parameters:

  • ids - The IDs of the documents to create
  • docs - The definition of how to create the documents
  • doNotifyListeners - Whether to notify listeners of the changes

Implementation

@protected
List<T> createLocalDocs({
  required List<CreateDocDef<T>> docs,
  bool doNotifyListeners = true,
}) {
  log.debug('Creating ${docs.length} local docs');
  final pDocs = <T>[];
  for (final doc in docs) {
    final pDoc = createLocalDoc(doc: doc, doNotifyListeners: false);
    pDocs.add(pDoc);
  }
  if (doNotifyListeners) docsPerIdInformer.rebuild();
  return pDocs;
}