RepositoryAddon<T extends DBModelI> class

Provide additional functionality to a FirebaseRepository

Constructors

RepositoryAddon({required FirebaseRepository<T> repository})
Provide additional functionality to a FirebaseRepository

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

fetch({required DocumentReference<Object?> ref, Source source = Source.serverAndCache}) Future<T>
Same as RepositoryAddon.transform but will return a Future with latest value in the DB using the given ref. If the given ref is not found, this will throw an exception.
multiFetch({required Iterable<DocumentReference<Object?>> refs, Source source = Source.serverAndCache}) Future<List<T>>
Same as RepositoryAddon.multiTransform but will return a Future with latest values in the DB using the given refs.
multiTransform({required Iterable<DocumentReference<Object?>> refs, bool includeMetadataChanges = false}) Stream<List<T>>
Transform the given refs to a List of Ts. The Stream will emmit new values each time there is a change in the DB.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
transform({required DocumentReference<Object?> ref, bool includeMetadataChanges = false}) Stream<T>
Transform the given ref to a Stream of Ts. The Stream will emmit new values each time there is a change in the DB.
tryFetch({required DocumentReference<Object?> ref, Source source = Source.serverAndCache}) Future<T?>
Same as RepositoryAddon.transform but will return a Future with latest value in the DB using the given ref. If the given ref is not found, this will return null without throwing any exception.

Operators

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

Static Methods

arrayUpdate({required DocumentReference<Object?> ref, required String field, required List values, bool add = true}) Future<void>
Update the array in the field of the Document ref with the given List of values.
getBatch() → WriteBatch
Same as Firestore.instance.batch
runTransaction<T>({required TransactionHandler<T> transactionHandler, Duration? timeout}) Future<T>
Same as Firestore.instance.runTransaction