SignalValueListenable<T, N extends ValueListenable<T> , S extends ReadonlySignal<T> > class
- Inheritance
-
- Object
- WrappedReadonlySignal<
T, S> - SignalValueListenable
- Implemented types
- Available extensions
Constructors
- SignalValueListenable.new(T val, {String? debugLabel, bool autoDispose = false})
-
SignalValueListenable from value
factory
- SignalValueListenable.fromSignal(S val)
-
SignalValueListenable from ReadonlySignal
factory
- SignalValueListenable.fromValueListenable(N val, {String? debugLabel, bool autoDispose = false})
-
SignalValueListenable from ValueListenable
factory
- SignalValueListenable.merge(N notifier, S source)
- Signal + ValueListenable
Properties
- autoDispose → bool
-
Throws and error if read after dispose and can be
disposed on last unsubscribe.
no setterinherited
- debugLabel → String?
-
Debug label for Debug Mode
no setterinherited
- disposed ↔ bool
-
Returns true if dispose has been called and will throw and
error on value read
getter/setter pairinherited
- globalId → int
-
Global ID of the signal
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasTargets → bool
-
Check if there are any targets attached
no setterinherited
- initialValue → T
-
Value that the signal was created with
no setterinherited
- isInitialized → bool
-
Check if the signal is lazy and has not had a value set
no setterinherited
- notifier → N
-
Internal value notifier
final
- previousValue → T?
-
Previous value that was set before the current
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- source → S
-
Internal source signal
finalinherited
-
targets
→ Iterable<
SignalListenable> -
@internal for testing getter to track all the effects currently
effected in the signal
no setterinherited
- value → T
-
Compute the current value
no setterinherited
- version → int
-
Version number is used to track changes and will increment for every set
no setterinherited
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object notifies its listeners.
override
-
call(
) → T -
Return the value when invoked
inherited
-
dispose(
) → void -
Dispose the signal
override
-
get(
) → T -
Get the current value
inherited
-
listen(
BuildContext context, void callback(), {String? debugLabel}) → void -
Available on ReadonlySignal<
Used to listen for updates on a signal but not rebuild the nearest elementT> , provided by the FlutterReadonlySignalUtils extension -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onDispose(
void cleanup()) → EffectCleanup -
Add a cleanup function to be called when the signal is disposed
inherited
-
peek(
) → T -
In the rare instance that you have an effect that should write to
another signal based on the previous value, but you don't want the
effect to be subscribed to that signal, you can read a signals's
previous value via
signal.peek()
.inherited -
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that the
object notifies.
override
-
select<
R> (R selector(ReadonlySignal< T> ), {bool autoDispose = false, String? debugLabel}) → Computed<R> -
Available on ReadonlySignal<
Select a value and return a computed signal to listen for changesT> , provided by the ReadonlySignalUtils extension -
subscribe(
void fn(T value)) → EffectCleanup -
Subscribe to value changes
inherited
-
toJson(
) → dynamic -
Convert value to JSON
inherited
-
toSignal(
{String? debugLabel}) → SignalValueListenable< T, ValueListenable< T> , ReadonlySignal<T> > -
Available on ValueListenable<
SignalValueNotifierT> , provided by the SignalValueListenableUtils extension -
toStream(
) → Stream< T> -
Available on ReadonlySignal<
Convert a signal to a Stream to be consumed as a read only stream.T> , provided by the ReadonlySignalUtils extension -
toString(
) → String -
A string representation of this object.
inherited
-
toValueListenable(
) → SignalValueListenable< T, ValueListenable< T> , ReadonlySignal<T> > -
Available on ReadonlySignal<
Convert a signal to ValueListenable to be used in builders and other existing widgets like ValueListenableBuilderT> , provided by the FlutterReadonlySignalUtils extension -
unlisten(
BuildContext context, void callback()) → void -
Available on ReadonlySignal<
Stop subscriptions to updates on a signal for listenersT> , provided by the FlutterReadonlySignalUtils extension -
unwatch(
BuildContext context) → void -
Available on ReadonlySignal<
Stop subscriptions to updates on a signal for watchersT> , provided by the FlutterReadonlySignalUtils extension -
watch(
BuildContext context, {String? debugLabel}) → T -
Available on ReadonlySignal<
Rebuild the Element that the current signal is inside ofT> , provided by the FlutterReadonlySignalUtils extension
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited