ReadSignal<T> class abstract

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 ReadableSignals because they depend on the value of a Signal.

Inheritance
Implementers
Available extensions

Constructors

ReadSignal({required String? name, ValueComparator<T?> comparator = identical, bool? equals, bool? autoDispose, bool? trackInDevTools, bool? trackPreviousValue})
A read-only Signal.

Properties

autoDispose bool
Whether to automatically dispose the signal (defaults to SolidartConfig.autoDispose).
finalinherited
comparator → ValueComparator<T?>
An optional comparator function, defaults to identical.
finalinherited
disposed bool
Tells if the signal is disposed;
no setterinherited
equals bool
Whether to check the equality of the value with the == equality.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
hasPreviousValue bool
Indicates if there is a previous value. It is especially helpful if T is nullable.
no setterinherited
hasValue bool
Whether or not the signal has been initialized with a value.
no setterinherited
listenerCount int
The total number of listeners subscribed to the signal.
no setterinherited
name String?
The name of the signal, useful for logging purposes.
finalinherited
previousValue → T?
The previous signal value
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
trackInDevTools bool
Whether to track the signal in the DevTools extension, defaults to SolidartConfig.devToolsEnabled.
finalinherited
trackPreviousValue bool
Whether to track the previous value of the signal, defaults to true
finalinherited
untrackedPreviousValue → T?
Returns the untracked previous value of the signal.
no setterinherited
untrackedValue → T
Returns the untracked value of the signal.
no setterinherited
value → T
The current signal value
no setterinherited

Methods

call() → T
The current signal value
inherited
dispose() → void
Diposes the signal
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
observe(ObserveCallback<T> listener, {bool fireImmediately = false}) DisposeObservation

Available on SignalBase<T>, provided by the ObserveSignal extension

Observe the signal and trigger the listener every time the value changes
onDispose(VoidCallback cb) → void
Fired when the signal is disposing
inherited
toString() String
A string representation of this object.
inherited
until(bool condition(T value), {Duration? timeout}) FutureOr<T>

Available on SignalBase<T>, provided by the Until extension

Returns the future that completes when the condition evaluates to true. If the condition is already true, it completes immediately.

Operators

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