FirestoreHelper class

Constructors

FirestoreHelper({FirebaseFirestore? firebaseFirestore, LoggingService? loggingService})

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

addDocument(String collection, Map<String, dynamic> update, {String? documentId}) Future<String?>
addSubCollectionDocument({required String collection, required String documentId, required String subCollection, required Map<String, dynamic> update, String? subCollectionDocumentId}) Future<String?>
areMoreElementsAvailable<T>({required Query<Object?> query, required DocumentSnapshot<Object?> lastDocumentSnapshot, required T onDocumentSnapshot(DocumentSnapshot<Object?> documentSnapshot)}) Future<bool>
deleteDocument(String collection, String documentId) Future<bool>
deleteSubCollectionDocument({required String collection, required String documentId, required String subCollection, required String subCollectionDocumentId}) Future<bool>
getElement<T>(String collection, String documentId, String logReference, {required T? onDocumentSnapshot(DocumentSnapshot<Object?> documentSnapshot)}) Future<T?>
getElements<T>({required Query<Object?> query, required String logReference, required T onDocumentSnapshot(DocumentSnapshot<Object?> documentSnapshot), DocumentSnapshot<Object?>? lastDocumentSnapshot}) Future<List<T>?>
Generic method used for retrieving items. It simplifies pagination flow, so services doesn't need to contain boilerplate code.
listenToDocument<T>(String collection, String documentId, String logReference, {required ValueSetter<DocumentSnapshot<Object?>> onDocumentChange}) StreamSubscription<DocumentSnapshot<Object?>>
listenToElementsCountStream({required String logReference, required Query<Object?> query, required ValueSetter<int> onCountChange}) StreamSubscription<QuerySnapshot<Object?>>
listenToElementsStream({required String logReference, required Query<Object?> query, required ValueSetter<DocumentChange<Object?>> onDocumentChange, DocumentSnapshot<Object?>? lastDocumentSnapshot}) StreamSubscription<QuerySnapshot<Object?>>
Listening for the stream of QuerySnapshot from Firestore.
listenToSubCollectionDocument<T>({required String collection, required String documentId, required String subCollection, required String subCollectionDocumentId, required String logReference, required ValueSetter<DocumentSnapshot<Object?>> onDocumentChange}) StreamSubscription<DocumentSnapshot<Object?>>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
updateDocument(String collection, String documentId, Map<String, dynamic> update) Future<bool>
updateSubCollectionsDocument({required String collection, required String documentId, required String subCollection, required String subCollectionDocumentId, required Map<String, dynamic> update}) Future<bool>

Operators

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