RepositoryFirestore<T> class
- Inheritance
-
- Object
- Repository<
T> - RepositoryFirestore
Constructors
-
RepositoryFirestore({required Map<
String, dynamic> toFirestore(T object), required T fromFirestore(DocumentReference<Map< ref, Map<String, dynamic> >String, dynamic> data), required String path, FirebaseFirestore? store, QueryBuilder<Query< ? queryBuilder, Query<Map< >String, dynamic> >Map< ? nativeQuery})String, dynamic> >
Properties
-
fromFirestore
→ T Function(DocumentReference<
Map< ref, Map<String, dynamic> >String, dynamic> data) -
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
nativeQuery
↔ Query<
Map< ?String, dynamic> > -
getter/setter pair
- path → String
-
The path or location of this repository.
final
-
queryBuilder
→ QueryBuilder<
Query< ?Map< >String, dynamic> > -
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- store ↔ FirebaseFirestore
-
latefinal
-
toFirestore
→ Map<
String, dynamic> Function(T object) -
final
Methods
-
add(
IdentifiedObject< T> item) → Future<T> -
Adds a new item to the repository.
override
-
addAll(
Iterable< IdentifiedObject< items) → Future<T> >Iterable< T> > -
Adds multiple items to the repository.
override
-
addAutoIdentified(
T object, {T updateObjectWithId(T object, String id)?}) → Future< T> -
Convenience method that combines autoIdentify and add.
override
-
autoIdentify(
T object, {T updateObjectWithId(T object, String id)?}) → IdentifiedObject< T> -
Generates a unique ID for an object and returns an IdentifiedObject.
override
-
delete(
String id) → Future< void> -
Deletes an item from the repository.
override
-
deleteAll(
Iterable< String> ids) → Future<void> -
Deletes multiple items from the repository.
override
-
dispose(
) → Future< void> -
Disposes of the repository and cleans up resources.
override
-
get(
String id) → Future< T> -
Returns the item with the given ID.
Throws RepositoryException.notFound if the item does not exist.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
query(
{Query query = const AllQuery()}) → Future< List< T> > -
Queries for items matching the given query.
override
-
stream(
String id) → Stream< T> -
Creates a real-time stream of changes for a specific document.
override
-
streamQuery(
{Query query = const AllQuery()}) → Stream< List< T> > -
Creates a real-time stream of query results.
override
-
toString(
) → String -
A string representation of this object.
inherited
-
update(
String id, T updater(T current)) → Future< T> -
Updates an existing item in the repository.
override
-
updateAll(
Iterable< IdentifiedObject< items) → Future<T> >Iterable< T> > -
Updates multiple items in the repository.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- typeConversionFromFirebase → MapConverter
-
final
- typeConversionToFirebase → MapConverter
-
final