ObservedStorage<E> class

Wrapper around Storage that notifies listeners when data change happens.

Use updates and updatesSticky to subscribe to update events.

Implemented types

Constructors

ObservedStorage(Storage<E> _inner)

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
silent Storage<E>
Returns Storage<E> that will not trigger updates or updatesSticky.
no setter
updates Stream<E?>
Returns a broadcast stream that emits updates when the data changes. null is a valid emitted item if E? is nullable or the item E is deleted.
no setter
updatesSticky Stream<E?>
Returns a broadcast stream that emits updates when the data changes, starting with any last emitted item first. null is a valid emitted item if E? is nullable or the item E is deleted.
no setter

Methods

delete() Future<void>
Deletes any written item. If no item is found completes without error.
override
get() Future<E?>
Retrieves the saved item or returns null if no item is found.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
save(E item) Future<E>
Saves the given item, overriding any previous entries.
override
teardown() Future<void>
Permanently closes this updates stream.
toString() String
A string representation of this object.
inherited

Operators

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