Observable<T> class Null safety

Observe value changes using a Future, Stream, and/or a callback.

Constructors

Observable({required T initialValue, void onChanged(T value)?, bool checkEquality = true})

Properties

canceled bool
read-only
checkEquality bool
If true, setting the value will only notifiy if the new value is different than the current value.
final
hashCode int
The hash code for this object.
read-onlyinherited
nextValue Future<T>
read-only
onChanged → (void Function?(T value)?)
final
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
value ↔ T
The current value of this observable.
read / write
values Stream<T>
read-only

Methods

cancel() → void
Permanently disables this observable. Further changes to value will be ignored, the outputs onChanged, nextValue, and values will not be called again.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
notify(T val) → void
setValue(T val) → void
Alias for value setter. Good for passing to a Future or Stream.
toString() String
A string representation of this object.
inherited

Operators

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