updateLocalDoc method
T
updateLocalDoc({
- required String id,
- required UpdateDocDef<
T> doc, - bool doNotifyListeners = true,
Updates an existing document in local state.
Parameters:
id
- The ID of the document to updatedoc
- The definition of how to update the documentdoNotifyListeners
- Whether to notify listeners of the change
Implementation
@protected
T updateLocalDoc({
required String id,
required UpdateDocDef<T> doc,
bool doNotifyListeners = true,
}) {
log.debug('Updating local doc with id: $id');
final pDoc = doc(
findById(id),
turboVars(id: id),
);
docsPerIdInformer.updateCurrent(
(value) => value
..update(
pDoc.id,
(_) => pDoc,
),
doNotifyListeners: doNotifyListeners,
);
return pDoc;
}