FirebaseRepository<T extends DBModelI> class
abstract
Provide additional functionality to a FirebaseRepository
Constructors
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
-
add(
{required T item, SetOptions? setOptions, required String type, DocumentReference< Object?> ? parent}) → Future<DocumentReference< Object?> > -
Given
item
will be added to the collection with nametype
, which is inside the documentparent
. Ifparent
is null, global collection with nametype
will be used to store theitem
. -
addList(
{required Iterable< T> items, required String type, DocumentReference<Object?> ? parent}) → Future<void> -
Same as FirebaseRepository.add but will store a Iterable of given
items
and return a Iterable ofDocumentReference
s. -
fromSnapshot(
DocumentSnapshot< Map< snapshot, SnapshotOptions? options) → TString, dynamic> > -
Returns a
T
(of DBModel) when asnapshot
is given. Can return null if thesnapshot
is in bad format. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
query(
{required QueryTransformer< T> spec, required String type, DocumentReference<Object?> ? parent, bool includeMetadataChanges = false}) → Stream<Iterable< T> > -
Query some data from a Firestore collection with name
type
in the document withDocumentReference
parent
according to the given rule in thespecification
. -
queryGroup(
{required QueryTransformer< T> spec, required String collectionPath, bool includeMetadataChanges = false}) → Stream<Iterable< T> > - Usage is as same as in the FirebaseRepository.query, but this is for collection group querying.
-
queryGroupSingle(
{required QueryTransformer< T> spec, required String collectionPath, Source source = Source.serverAndCache}) → Future<Iterable< T> > - Same as FirebaseRepository.queryGroup but instead of returning a Stream this will return a Future with the latest values in the Firestore.
-
querySingle(
{required QueryTransformer< T> spec, required String type, DocumentReference<Object?> ? parent, Source source = Source.serverAndCache}) → Future<Iterable< T> > - Same as FirebaseRepository.query but instead of returning a Stream this will return a Future with the latest values in the Firestore.
-
remove(
{required T item}) → Future< void> -
Delete the document corresponding to the
item
. If the reference of theitem
(DBModel.ref) is null nothing will happen. -
toMap(
T value, SetOptions? options) → Map< String, Object?> -
Converts the given
item
to a Map that can be stored in Firestore. -
toString(
) → String -
A string representation of this object.
inherited
-
update(
{required T item, SetOptions? setOptions, required String type, DocumentReference< Object?> ? parent, MapperCallback<T> ? mapper}) → Future<DocumentReference< Object?> > -
Update the document which is corresponding to the given
item
.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited