Observable<T> class
A minimal observable value: holds a current value and notifies listeners on change via a broadcast stream. The web app's lightweight alternative to a state-management framework — screens subscribe and re-render their DOM subtree when the value changes.
Constructors
- Observable(T initial)
-
Creates an observable seeded with
initial.
Properties
Methods
-
dispose(
) → Future< void> - Releases the underlying stream controller.
-
listen(
void listener(T value)) → StreamSubscription< T> -
Subscribes
listener, invoking it immediately with the current value and again on every change. Returns the subscription for cancellation. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notify(
) → void - Forces a notification even when the value is unchanged (e.g. after an in-place mutation of a collection held by reference).
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited