FirestoreService class

A service class to handle Firestore operations, including subdocuments. Provides methods for CRUD operations, queries, transactions, and real-time listeners.

Constructors

FirestoreService.new()

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

collectionStream(String collectionPath) Stream<List<QueryDocumentSnapshot<Object?>>>
createDocument(String collectionPath, Map<String, dynamic> data) Future<void>
createSubDocument(String collectionPath, String docId, String subCollection, Map<String, dynamic> data) Future<void>
Add a subdocument to a specific document in a collection.
deleteDocument(String collectionPath, String docId) Future<void>
deleteSubDocument(String collectionPath, String docId, String subCollection, String subDocId) Future<void>
Delete a specific subdocument from a subcollection.
documentStream(String collectionPath, String docId) Stream<DocumentSnapshot<Object?>>
getCollection(String collectionPath) Future<List<QueryDocumentSnapshot<Object?>>>
getDocument(String collectionPath, String docId) Future<DocumentSnapshot<Object?>>
getSubCollection(String collectionPath, String docId, String subCollection) Future<List<QueryDocumentSnapshot<Object?>>>
Get all subdocuments from a subcollection.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
paginateCollection(String collectionPath, {DocumentSnapshot<Object?>? startAfter, int limit = 10}) Future<List<QueryDocumentSnapshot<Object?>>>
queryCollection(String collectionPath, String field, dynamic value) Future<List<QueryDocumentSnapshot<Object?>>>
runTransaction(String collectionPath, String docId) Future<void>
setDocument(String collectionPath, String docId, Map<String, dynamic> data) Future<void>
toString() String
A string representation of this object.
inherited
updateDocument(String collectionPath, String docId, Map<String, dynamic> data) Future<void>
updateSubDocument(String collectionPath, String docId, String subCollection, String subDocId, Map<String, dynamic> data) Future<void>
Update a specific subdocument within a subcollection.

Operators

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