FirestoreCloudDatabase class

A implementation that uses Firestore as the backend. This is used to store data via actions for the SDK.

Inheritance

Constructors

FirestoreCloudDatabase(String identifier, FirebaseFirestore firestore, PublishSource publishSource)
Creates a FirestoreCloudDatabase with the given identifier and firestore instance.

Properties

firestore → FirebaseFirestore
Reference to the Firestore instance.
final
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
identifier String
Used to identify the instance of the cloud storage this SDK session is using. This is used to separate data for different projects and users. The actual identity of this depends on the implementation.
finalinherited
publishSource PublishSource
finalinherited
rootRef → DocumentReference<Map<String, dynamic>>
Reference to the root document for this session.
latefinal
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addDocument(String path, {String? documentId, bool autoGenerateId = false, bool skipCreationIfDocumentExists = true, required Map<String, dynamic> value}) Future<bool>
Adds a document to the cloud storage at the given path.
override
addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
dispose() → void
Discards any resources used by the object. After this is called, the object is not in a usable state and should be discarded (calls to addListener will throw after the object is disposed).
override
getCollectionPath(String path) → CollectionReference<Map<String, dynamic>>
Gives a collection reference for the given path.
getDocPath(String path, String? documentId) → DocumentReference<Map<String, dynamic>>
Gives a document reference for the given path.
getDocumentData(String path, String documentId) Future<Map<String, dynamic>>
Retrieves the document data from the cloud storage at the given path with the given documentId.
override
init() Future<void>
Initializes the cloud storage for the given identifier. This must be called and awaited before using the cloud storage.
log(String message) → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
removeDocument(String path, String documentId) Future<bool>
Removes a document from the cloud storage at the given path with the given documentId.
override
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
reset() → void
override
streamCollectionToVariable(String path, Observable<VariableData> variable, {required List<WhereQueryFilter> whereFilters, required List<OrderByQueryFilter> orderByOperations, int? limit, required ScopedValues scopedValues, required NullSubstitutionMode nullSubstitutionMode}) → void
override
streamDocument(String path, String documentId) Stream<Map<String, dynamic>>
Streams document data from the cloud storage at the given path with the given documentId.
override
streamDocumentToVariable(String path, String documentId, Observable<VariableData> variable) → void
Streams document data from the cloud storage at the given path with the given documentId and updates the given variable with the data when there is an update.
override
toString() String
A string representation of this object.
inherited
updateDocument(String path, {required String documentId, required Map<String, dynamic> value}) Future<bool>
Updates a document in the cloud storage at the given path with the given documentId.
override

Operators

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