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 givenref
is not found, this will throw an exception. -
multiFetch(
{required Iterable< DocumentReference< refs, Source source = Source.serverAndCache}) → Future<Object?> >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< refs, bool includeMetadataChanges = false}) → Stream<Object?> >List< T> > -
Transform the given
refs
to aList
ofT
s. 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 ofT
s. 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 givenref
is not found, this will returnnull
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 Documentref
with the given List ofvalues
. -
getBatch(
) → WriteBatch -
Same as
Firestore.instance.batch
-
runTransaction<
T> ({required TransactionHandler< T> transactionHandler, Duration? timeout}) → Future<T> -
Same as
Firestore.instance.runTransaction