updateLocalDoc method
DTO
updateLocalDoc({
- required String id,
- required UpdateDocDef<
DTO, MODEL> 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
DTO updateLocalDoc({
required String id,
required UpdateDocDef<DTO, MODEL> doc,
bool doNotifyListeners = true,
}) {
log.debug('Updating local doc with id: $id');
final pDoc = doc(
findById(id),
vars(id: id),
);
docsNotifier.updateCurrent(
(value) => value
..upsertDto(
pDoc,
),
doNotifyListeners: doNotifyListeners,
);
return pDoc;
}