ReadSignal<T> class

A read-only Signal.

When you don't need to expose the setter of a Signal, you should consider transforming it in a ReadSignal using the toReadSignal method.

All derived-signals are ReadSignals because they depend on the value of a Signal.

Implemented types
Implementers

Constructors

ReadSignal(T initialValue, {SignalOptions<T>? options})
A read-only Signal.
factory

Properties

disposed bool
getter/setter pairinherited-setter
hashCode int
The hash code for this object.
no setterinherited
hasObservers bool
no setterinherited
hasPreviousValue bool
Indicates if there is a previous value. It is especially helpful if T is nullable.
no setteroverride
listenerCount int
Returns the number of listeners listening to this signal.
no setteroverride
name String
finalinherited
options SignalOptions<T>
Options used to customize the behaviour of a signal
final
previousValue → T?
The previous value, if any.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value → T
The current signal value
no setteroverride

Methods

call() → T
The current signal value
override
dispose() → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
observe(ObserveCallback<T> listener, {bool fireImmediately = false}) DisposeObservation
Observe the signal and trigger the listener every time the value changes
override
onDispose(VoidCallback cb) → void
Fired when the signal is disposing
override
toString() String
A string representation of this object.
override
until(bool condition(T value)) FutureOr<T>
Returns the future that completes when the condition evalutes to true. If the condition is already true, it completes immediately.

Operators

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