createLocalDoc method

  1. @protected
T createLocalDoc({
  1. required CreateDocDef<T> doc,
  2. bool doNotifyListeners = true,
})

Creates a new document in local state.

Parameters:

  • id - The ID of the document to create
  • doc - The definition of how to create the document
  • doNotifyListeners - 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;
}