FirestoreSource<T> class

Firestore implementation of Source.

Inheritance
  • Object
  • DataContract<T>
  • FirestoreSource

Constructors

FirestoreSource(FirebaseFirestore firestore, {required Bindings<T>? bindings, required String collectionName, List<String> onCreateServerTimestampFields = const [], List<String> onUpdateServerTimestampFields = const []})
Firestore implementation of Source.

Properties

bindings ↔ Bindings<T>
All meta information about T necessary to plug arbitrary data types into a Repository.
getter/setter pairinherited
collection → CollectionReference<Json>
The Firestore collection for this source.
no setter
collectionName → String
The collection name from the Firestore console.
final
firestore → FirebaseFirestore
Firestore, baby!
final
hasBindings → bool
Proxy getter for whether bindings has been initialized, either by being passed in via this constructor or by being set by the SourceList.
no setterinherited
hashCode → int
The hash code for this object.
no setterinherited
onCreateServerTimestampFields → List<String>
Fields that should be set to FieldValue.serverTimestamp() on create.
final
onUpdateServerTimestampFields → List<String>
Fields that should be set to FieldValue.serverTimestamp() on every write
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sourceType ↔ SourceType
Indicator for whether this Source loads data from a store on-device, or off-device.
getter/setter pair
supportedOperations → Set<SourceOperationType>
The operations supported by this loader instance. Defaults to standard CRUD operations.
no setterinherited

Methods

deleteItem(DeleteOperation<T> operation) → Future<DeleteResult<T>>
Clears an item with the given DeleteOperation.itemId if one exists.
override
deleteItems(DeleteListOperation<T> operation) → Future<DeleteResult<T>>
Clears all items matching the given DeleteListOperation.details.
override
getById(ReadOperation<T> operation) → Future<ReadResult<T>>
Loads the instance of T whose primary key is found at ReadOperation.itemId.
override
getByIds(ReadByIdsOperation<T> operation) → Future<ReadListResult<T>>
Loads all instances of T whose primary key is in the set at ReadByIdsOperation.itemIds.
override
getItems(ReadListOperation<T> operation) → Future<ReadListResult<T>>
Loads all instances of T that satisfy any filtes or pagination on ReadListOperation.details.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
raw(String id, Json map) → Future<void>
Merges an arbitrary Json map into the document with id.
setItem(WriteOperation<T> operation) → Future<WriteResult<T>>
Persists WriteOperation.item.
override
setItems(WriteListOperation<T> operation) → Future<WriteListResult<T>>
Persists all WriteListOperation.items.
override
supports(SourceOperationType type) → bool
Returns whether this instance supports the given SourceOperationType.
inherited
toString() → String
A string representation of this object.
inherited
watch(WatchOperation<T> operation) → Stream<ReadResult<T>>
Opens a live stream which will yield the current matching model periodically via a ReadResult.
watchByIds(WatchByIdsOperation<T> operation) → Stream<ReadListResult<T>>
Opens a live stream which will yield the current matching models periodically via a ReadListResult.
watchList(WatchListOperation<T> operation) → Stream<ReadListResult<T>>
Opens a live stream which will yield the current matching models periodically via a ReadListResult.

Operators

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

Static Methods

cleanData(Json data) → Json
Converts Firebase Timestamp values into Dart DateTimes.
cleanDataForWrite(Json data) → Json
Converts Dart DateTimes into Firebase Timestamp values.