createLocalDoc method
Creates a new document in local state.
Parameters:
id- The ID of the document to createdoc- The definition of how to create the documentdoNotifyListeners- Whether to notify listeners of the change
Implementation
@protected
DTO createLocalDoc({
required CreateDocDef<DTO, MODEL> doc,
bool doNotifyListeners = true,
}) {
final pDoc = doc(
vars(),
);
log.debug('Creating local doc with id: ${pDoc.id}');
docsNotifier.updateCurrent(
(value) => value..upsertDto(pDoc),
doNotifyListeners: doNotifyListeners,
);
return pDoc;
}