DatabaseReferencePlatform class abstract
DatabaseReference represents a particular location in your Firebase Database and can be used for reading or writing data to that location.
This class is the starting point for all Firebase Database operations.
After you’ve obtained your first DatabaseReference via
FirebaseDatabase.ref()
, you can use it to read data
(ie. onChildAdded
), write data (ie. setValue
), and to create new
DatabaseReference
s (ie. child
).
Note: QueryPlatform extends PlatformInterface already.
- Inheritance
-
- Object
- PlatformInterface
- QueryPlatform
- DatabaseReferencePlatform
Properties
- database → DatabasePlatform
-
The Database instance associated with this query
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → String?
-
Gets the last token in a Firebase Database location (e.g. ‘fred’ in
https://SampleChat.firebaseIO-demo.com/users/fred)
no setter
- parent → DatabaseReferencePlatform?
-
Gets a DatabaseReference for the parent location. If this instance
refers to the root of your Firebase Database, it has no parent, and
therefore parent() will return null.
no setter
- path → String
-
Returns the path to this reference.
no setterinherited
- ref → DatabaseReferencePlatform
-
Obtains a DatabaseReference corresponding to this query's location.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
child(
String path) → DatabaseReferencePlatform - Gets a DatabaseReference for the location at the specified relative path. The relative path can either be a simple child key (e.g. ‘fred’) or a deeper slash-separated path (e.g. ‘fred/name/first’).
-
get(
QueryModifiers modifiers) → Future< DataSnapshotPlatform> -
Gets the most up-to-date result for this query.
inherited
-
keepSynced(
QueryModifiers modifiers, bool value) → Future< void> -
By calling keepSynced(true) on a location, the data for that location will
automatically be downloaded and kept in sync, even when no listeners are
attached for that location. Additionally, while a location is kept synced,
it will not be evicted from the persistent disk cache.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
observe(
QueryModifiers modifiers, DatabaseEventType eventType) → Stream< DatabaseEventPlatform> -
Assigns the proper event type to a stream for DatabaseEventPlatform
inherited
-
onChildAdded(
QueryModifiers modifiers) → Stream< DatabaseEventPlatform> -
Fires when children are added.
inherited
-
onChildChanged(
QueryModifiers modifiers) → Stream< DatabaseEventPlatform> -
Fires when children are changed.
inherited
-
onChildMoved(
QueryModifiers modifiers) → Stream< DatabaseEventPlatform> -
Fires when children are moved.
inherited
-
onChildRemoved(
QueryModifiers modifiers) → Stream< DatabaseEventPlatform> -
Fires when children are removed.
previousChildKey
is null.inherited -
onDisconnect(
) → OnDisconnectPlatform - Returns an OnDisconnectPlatform object
-
onValue(
QueryModifiers modifiers) → Stream< DatabaseEventPlatform> -
Fires when the data at this location is updated.
previousChildKey
is null.inherited -
push(
) → DatabaseReferencePlatform - Generates a new child location using a unique key and returns a DatabaseReference to it. This is useful when the children of a Firebase Database location represent a list of items.
-
remove(
) → Future< void> - Remove the data at this Firebase Database location. Any data at child locations will also be deleted.
-
root(
) → DatabaseReferencePlatform - Gets a FIRDatabaseReference for the root location.
-
runTransaction(
TransactionHandler transactionHandler, {bool applyLocally = true}) → Future< TransactionResultPlatform> - Performs an optimistic-concurrency transactional update to the data at this Firebase Database location.
-
set(
Object? value) → Future< void> -
Write
value
to the location. -
setPriority(
Object? priority) → Future< void> - Sets a priority for the data at this Firebase Database location.
-
setWithPriority(
Object? value, Object? priority) → Future< void> -
Write a
value
to the location with the specifiedpriority
if applicable. -
toString(
) → String -
A string representation of this object.
inherited
-
update(
Map< String, Object?> value) → Future<void> -
Update the node with the
value
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited