RTDB class
A utility class for interacting with Firebase Realtime Database (RTDB).
This class provides methods to perform CRUD operations (Create, Read, Update, Delete), observe real-time data changes, and enforce rate limiting to manage API usage.
Note: The implementation differs between web and non-web platforms due to platform-specific constraints on maintaining persistent connections.
For more information on the Firebase Realtime Database plugin, see the documentation.
Properties
- debug ↔ bool
-
Enables or disables debug logging.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- maxConnections → int
-
Rate limiting configurations.
final
- maxDataPerMinute → int
-
final
- maxReadsPerMinute → int
-
final
- maxWritesPerMinute → int
-
final
- pollingIntervalMs → int
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- user → User
-
The authenticated Firebase
User
associated with this RTDB instance.final
Methods
-
createUniqueDoc(
String path, Map< String, dynamic> data) → Future<String?> -
Creates a new unique document at the specified
path
in the RTDB. -
deleteData(
String path) → Future< bool> -
Deletes data from the specified
path
in the RTDB. -
dispose(
) → void - Disposes of all active stream subscriptions and resets rate limits.
-
getData(
String path, {bool shallow = true, Map< String, String> ? query}) → Future -
///////////////
///////////////
Retrieves data from the specified
path
in the RTDB. -
getNestedField(
Map< String, dynamic> data, String path) → dynamic - Retrieves a nested field from a JSON-like Firestore document.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
observeRealtimeDBValue<
T> (String path) → Future< ValueNotifier< T?> > - /////////////// /////////////// Observes a specific field in a Firestore document in real-time.
-
parseFirestoreData(
dynamic data) → dynamic - Parses Firestore-specific data types into standard Dart types.
-
toString(
) → String -
A string representation of this object.
inherited
-
updateData(
String path, Map< String, dynamic> data) → Future<bool> -
Updates existing
data
at the specifiedpath
in the RTDB. -
writeData(
String path, Map< String, dynamic> data) → Future<bool> -
Writes
data
to the specifiedpath
in the RTDB.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited