FirestoreCollection class
Implementation of Repository. Manages data inside a Firebase Firestore collection.
- Implemented types
Constructors
- FirestoreCollection({required String collectionId, dynamic onDocUpdate(Model, bool)?})
- Creates a new FirestoreCollection.
Properties
- collectionId → String
-
Id of the collection to manage.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- onDocUpdate → dynamic Function(Model, bool)?
-
Callback for real time updates.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
clear(
{String? userId}) → Future< void> -
Deletes all the entries of the repository.
If
userId
is not null, the only enties that will be deleted will have the same user id.override -
count(
{String? userId, Where? where}) → Future< int> -
Returns the number of entries in the repository.
override
-
create(
{String? wantedId}) → Future< Model> -
Creates a new entry in the repository.
override
-
delete(
Model item) → Future< void> -
Deletes an entry in the repository.
override
-
deleteWhere(
Where where) → Future< void> -
Deletes all the entries that are compliant to the
where
clause.override -
get(
String id) → Future< Model> -
Returns the entry with the specified
id
.override -
getAll(
{String? userId, Where? where, String? orderBy, bool descending = true}) → Future< List< Model> > -
Returns all the entries in the repository.
If
userId
is not null, the results will have the same user id. Ifwhere
is not null, the results will be compliant to the where clause.override -
initialize(
) → Future< void> -
Initialize the repository.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
update(
Model item) → Future< void> -
Updates an entry in the repository.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited