LocalStore class

Define a datastore structure for local use.

Preserves NoSQL structure in Json at runtime.

Json can be encoded and saved to a local file or to a remote DB. In such cases, use onInitialize, onLoad, onSaved, and onDeleted to describe the external linkage.

Constructors

LocalStore({Future<void> onInitialize()?, Future<void> onLoad()?, Future<void> onSaved()?, Future<void> onDeleted()?})

Properties

hashCode int
The hash code for this object.
no setterinherited
isInitialized bool
Returns True if the database is initialized.
no setter
onDeleted → (Future<void> Function()?)
Callback when data is deleted.
final
onInitialize → (Future<void> Function()?)
Callbacks during initialization.
final
onLoad → (Future<void> Function()?)
Callback when data is loaded.
final
onSaved → (Future<void> Function()?)
Callback when data is saved.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addCollectionListener(LocalStoreCollectionQuery query) → void
addDocumentListener(LocalStoreDocumentQuery query) → void
addMockDocument(String path, DynamicMap value) → void
deleteDocument(LocalStoreDocumentQuery query) Future<void>
initialize() Future<void>
Initialize the database.
loadCollection(LocalStoreCollectionQuery query) Future<Map<String, DynamicMap>?>
loadDocument(LocalStoreDocumentQuery query) Future<DynamicMap?>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyDocuments(String path, String key, DynamicMap value, LocalStoreDocumentUpdateStatus status, LocalStoreDocumentQuery query) → void
removeCollectionListener(LocalStoreCollectionQuery? query) → void
removeDocumentListener(LocalStoreDocumentQuery? query) → void
replace(DynamicMap replaceData) Future<void>
saveDocument(LocalStoreDocumentQuery query, DynamicMap value) Future<void>
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited