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
T createLocalDoc({
required CreateDocDef<T> doc,
bool doNotifyListeners = true,
}) {
final pDoc = doc(
turboVars(),
);
log.debug('Creating local doc with id: ${pDoc.id}');
docsPerIdInformer.updateCurrent(
(value) => value..[pDoc.id] = pDoc,
doNotifyListeners: doNotifyListeners,
);
return pDoc;
}