SimpleFirestore class
A utility class for interacting with Firestore.
This class provides methods for common Firestore operations such as reading, writing, observing real-time updates, and parsing Firestore-specific data types.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
streams
→ List<
StreamSubscription> -
final
Methods
-
createUniqueDocument(
String collectionPath, Map< String, dynamic> data) → Future<String?> - Creates a new document in a Firestore collection with a unique ID.
-
deleteData(
String documentPath) → Future< bool> - Deletes a Firestore document.
-
getData(
String documentPath) → Future< Map< String, dynamic> ?> - Reads data from a Firestore document.
-
getNestedField(
Map< String, dynamic> data, String path) → dynamic - Retrieves a nested field from a JSON-like Firestore document.
-
isOnline(
) → Future< bool> - Checks if the device has an active internet connection via pinging cloudFlare's 1.1.1.1
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
observeFirestoreDocument(
String documentPath) → ValueNotifier< Map< String, dynamic> ?> - Observes a Firestore document in real-time.
-
observeFirestoreValue<
T> (String documentPath, String fieldPath) → ValueNotifier< T?> - Observes a specific field in a Firestore document in real-time.
-
parseFirestoreData(
dynamic data) → dynamic - Parses Firestore data types into standard Dart types.
-
toString(
) → String -
A string representation of this object.
inherited
-
updateData(
String documentPath, Map< String, dynamic> data) → Future<bool> -
Updates data in Firestore for an existing document using
update
. -
writeData(
String documentPath, Map< String, dynamic> data, {bool merge = false}) → Future<bool> - Writes data to a Firestore document via set
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited