updateLocalDocs method

  1. @protected
List<T> updateLocalDocs({
  1. required List<String> ids,
  2. required UpdateDocDef<T> doc,
  3. bool doNotifyListeners = true,
})

Updates multiple existing documents in local state.

Parameters:

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

Implementation

@protected
List<T> updateLocalDocs({
  required List<String> ids,
  required UpdateDocDef<T> doc,
  bool doNotifyListeners = true,
}) {
  log.debug('Updating ${ids.length} local docs');
  final pDocs = <T>[];
  for (final id in ids) {
    final pDoc = updateLocalDoc(id: id, doc: doc, doNotifyListeners: false);
    pDocs.add(pDoc);
  }
  if (doNotifyListeners) docsPerIdInformer.rebuild();
  return pDocs;
}