FireStoreService class abstract

This class is for FirebaseFirestore Manager to perform all Firestore operations

Constructors

FireStoreService()

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<T extends FireStoreDoc>(T obj, CollectionReference<Object?> collectionReference) Future<T>
obj is a user custom object which extends FireStoreDoc, This method is used to add a new document to a collection.
addUpdateDocument(FireStoreDoc obj, DocumentReference<Object?> documentReference) Future
This function is used to completely replace the data in a document with the provided object. If the document does not exist, this method will create a new document with the provided object. If the document already exists, it will overwrite the existing data with the new object.
delete(DocumentReference<Object?> docRef) Future
This method is used to delete a document When you call this method, Firestore deletes the entire document and all of its contents from the database.
get<T extends FireStoreDoc>(DocumentReference<T> docRef) Future<T?>
This function is used to get document from a Firestore collection using its reference
getCollectionRef<T extends FireStoreDoc>(String path, FromFirestore<T> fromFirestore) → CollectionReference<T>
A method that returns a CollectionReference object for a Firestore collection located at a specified path, with a specified fromFirestore function to convert Firestore documents to objects of type T.
getCountDocumentRef<T extends FireStoreDoc>(String collectionPath, String docPath) → DocumentReference<Object?>
A method that returns a DocumentReference
getDocumentRef<T extends FireStoreDoc>(String path, FromFirestore<T> fromFirestore) → DocumentReference<T>
A method that returns a DocumentReference object for a Firestore document located at a specified path, with a specified fromFirestore function to convert Firestore documents to objects of type T.
getList<T extends FireStoreDoc>(CollectionReference<T> colRef) Future<List<T>>
A method that retrieves all documents from a Firestore collection specified by a colRef
getListByQuery<T extends FireStoreDoc>(Query<T> query) Future<List<T>>
A method that retrieves all documents from a Firestore collection that match a specified query.
getListStream<T extends FireStoreDoc>(CollectionReference<T> colRef) Stream<List<T>>
This method is used to fetch stream of data from collection colRef that represents the Firestore collection from which the data is retrieved.
getListStreamByQuery<T extends FireStoreDoc>(Query<T> query) Stream<List<T>>
This method is used to fetch stream of data from firestore db for Query based result
getSubCollectionRef<T extends FireStoreDoc>(String collectionPath, String docPath, String subCollection, FromFirestore<T> fromFirestore) → CollectionReference<T>
a method that returns a CollectionReference object for a sub collection of a Firestore document located at a specified path, with a specified fromFirestore function to convert Firestore documents to objects of type T.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
update(FireStoreDoc obj, DocumentReference<Object?> docRef) Future
This method is used to update specific fields in a document with the provided object. This method only updates the fields that are specified in the object, leaving the other fields unchanged If the document does not exist, this method will throw an error.
updateField(Map<String, Object?> obj, DocumentReference<Object?> docRef) Future
Method is used to update specific fields in a document with a JavaScript object The object obj contains key-value pairs where the keys represent the field names to update and the values represent the new values to set for those fields

Operators

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

Static Methods

getInstance(FirebaseFirestore fireStore) FireStoreService