FlutterSignal<T> class
Simple writeable single
- Inheritance
- Implemented types
-
- ValueNotifier<
T> - ReadonlySignal<
T> - ValueListenable<
T>
- ValueNotifier<
- Mixed-in types
- Available extensions
Constructors
- FlutterSignal(T internalValue, {bool autoDispose = false, String? debugLabel})
- Simple writeable signal.
- FlutterSignal.lazy({bool autoDispose = false, String? debugLabel})
- Lazy signal that can be created with type T that the value will be assigned later.
Properties
- autoDispose ↔ bool
-
Throws and error if read after dispose and can be
disposed on last unsubscribe.
getter/setter pairinherited
- brand → Symbol
-
finalinherited
- debugLabel → String?
-
Debug label for Debug Mode
finalinherited
- disposed ↔ bool
-
Check if the effect is disposed
getter/setter pairinherited
- equalityCheck ↔ bool Function(T a, T b)
-
Optional method to check if to values are the same
getter/setter pairinherited
- globalId → int
-
Global ID of the signal
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- internalValue ↔ T
-
getter/setter pairinherited
- isInitialized ↔ bool
-
Check if the value is set and not a lazy signal
getter/setter pairinherited
- node ↔ Node?
-
getter/setter pairinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- targets ↔ Node?
-
getter/setter pairinherited
- untrackedValue → T
-
Available on ReadonlySignal<
Runs a callback function that returns the signal value without subscribing to the signal updates.T> , provided by the ReadonlySignalUntrackedValueUtils extensionno setter - value ↔ T
-
Compute the current value
getter/setter pairinherited
- version ↔ int
-
Version numbers should always be >= 0, because the special value -1 is used
by Nodes to signify potentially unused but recyclable nodes.
getter/setter pairinherited
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
afterCreate(
T val) → void -
Internal hook for after a signal is created
inherited
-
beforeUpdate(
T val) → void -
Internal hook for after a signal is updated
inherited
-
call(
) → T -
Return the value when invoked
inherited
-
dispose(
) → void -
Dispose the signal
inherited
-
get(
) → T -
Helper method to get the current value
inherited
-
internalRefresh(
) → bool -
inherited
-
internalSetValue(
T val) → void -
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
onDispose(
void cleanup()) → EffectCleanup -
Add a cleanup function to be called when the signal is disposed
inherited
-
overrideWith(
T val) → Signal< T> -
Override the current signal with a new value as if it was created with it
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 -
readonly(
) → ReadonlySignal< T> -
Returns a readonly signal
inherited
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
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 -
set(
T val, {bool force = false}) → bool -
Set the current value by a method
inherited
-
subscribe(
void fn(T value)) → void Function() -
Subscribe to value changes with a dispose function
inherited
-
subscribeToNode(
Node node) → void -
inherited
-
toJson(
) → dynamic -
Convert value to JSON
inherited
-
toSignal(
{String? debugLabel, bool autoDispose = false}) → ReadonlySignal< T> -
Available on ValueListenable<
SignalValueNotifierT> , provided by the SignalValueListenableUtils extension -
toSignal(
{String? debugLabel, bool autoDispose = false}) → Signal< T> -
Available on ValueNotifier<
SignalValueNotifierT> , provided by the SignalValueNotifierUtils 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
-
unsubscribeFromNode(
Node node) → void -
inherited
-
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