OnDisconnect class abstract

The Disconnect class encapsulates all operations to be performed on a Firebase when the client is disconnected. This allows you to write or clear data when your client disconnects from the Firebase servers. These updates occur whether your client disconnects cleanly or not, so you can rely on them to clean up data even if a connection is dropped or a client crashes.

Note that these functions should be called before any data is written to avoid problems if a connection is dropped before the requests can be transferred to the Firebase servers.

Note that onDisconnect operations are only triggered once. If you want an operation to occur each time a disconnect occurs, you'll need to re-establish the operations each time.

Constructors

OnDisconnect()

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

cancel() Future<void>
Cancel all previously queued onDisconnect() set or update events for this location and all children.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
remove() Future<void>
Ensure the data at this location is deleted when the client is disconnected (due to closing the browser, navigating to a new page, or network issues).
set(dynamic value, {dynamic priority}) Future<void>
Ensure the data at this location is set to the specified value and priority when the client is disconnected (due to closing the browser, navigating to a new page, or network issues).
toString() String
A string representation of this object.
inherited
update(Map<String, dynamic> value) Future<void>
Write the enumerated children at this Firebase location when the client is disconnected (due to closing the browser, navigating to a new page, or network issues). This will overwrite only children enumerated in the 'value' parameter and will leave others untouched.

Operators

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