signals_flutter library

Classes

AsyncData<T>
State for an AsyncState with a value
AsyncError<T>
State for an AsyncState with an error
AsyncLoading<T>
State for an AsyncState with a loading state
AsyncSignal<T>
A compound Signal that wraps a Stream or Future
AsyncState<T>
State for an AsyncSignal
Computed<T>
Data is often derived from other pieces of existing data. The computed function lets you combine the values of multiple signals into a new signal that can be reacted to, or even used by additional computeds. When the signals accessed from within a computed callback change, the computed callback is re-executed and its new return value becomes the computed signal's value.
Connect<T>
Connects a Stream to a Signal.
FutureSignal<T>
IterableSignal<E>
A Signal that holds a Iterable.
ListSignal<E>
A Signal that holds a List.
LoggingSignalsObserver
MapSignal<K, V>
A Signal that holds a Map.
ReadonlySignal<T>
SetSignal<E>
A Signal that holds a Set.
Signal<T>
The signal function creates a new signal. A signal is a container for a value that can change over time. You can read a signal's value or subscribe to value updates by accessing its .value property.
SignalContainer<T, Arg, S extends ReadonlySignal<T>>
Signal container used to create signals based on args
SignalsObserver
StreamSignal<T>
TimerSignal
Emit recurring TimerSignalEvent aka AsyncSignal
ValueSignal<T>
Signal that can be extended and used as a class
Watch<T extends Widget>
Watch is a drop-in replacement for Builder that will rebuild when any signals inside the builder change

Extensions

FlutterReadonlySignalUtils on ReadonlySignal<T>
Signal extensions
FlutterSignalUtils on Signal<T>
Mutable signal utils
SignalFutureUtils on Future<T>
Extension on future to provide helpful methods for signals
SignalIterableUtils on Iterable<T>
Extension on future to provide helpful methods for signals
SignalListUtils on List<T>
Extension on future to provide helpful methods for signals
SignalMapUtils on Map<K, V>
Extension on future to provide helpful methods for signals
SignalSetUtils on Set<T>
Extension on future to provide helpful methods for signals
SignalStreamUtils on Stream<T>
Extension on stream to provide helpful methods for signals
SignalValueListenableUtils on ValueListenable<T>
Extension on ValueListenable to provide helpful methods for signals
SignalValueNotifierUtils on ValueNotifier<T>
Extension on ValueNotifier to provide helpful methods for signals
TimerSignalDurationUtils on Duration
Expose Duration as a TimerSignal

Functions

batch<T>(BatchCallback<T> callback) → T
The batch function allows you to combine multiple signal writes into one single update that is triggered at the end when the callback completes.
computed<T>(ComputedCallback<T> compute, {String? debugLabel}) Computed<T>
Data is often derived from other pieces of existing data. The computed function lets you combine the values of multiple signals into a new signal that can be reacted to, or even used by additional computeds. When the signals accessed from within a computed callback change, the computed callback is re-executed and its new return value becomes the computed signal's value.
connect<T>(Signal<T> signal, [Stream<T>? stream]) Connect<T>
Connects a Signal to a Stream.
disableSignalsDevTools() → void
effect(EffectCallback compute, {String? debugLabel}) EffectCleanup
The effect function is the last piece that makes everything reactive. When you access a signal inside its callback function, that signal and every dependency of said signal will be activated and subscribed to. In that regard it is very similar to computed. By default all updates are lazy, so nothing will update until you access a signal inside effect.
futureSignal<T>(Future<T> future(), {T? initialValue, String? debugLabel, bool fireImmediately = false}) FutureSignal<T>
iterableSignal<T>(Iterable<T> iterable, {String? debugLabel}) IterableSignal<T>
Create an IterableSignal from Iterable
listenSignal<T>(BuildContext context, ReadonlySignal<T> signal, void callback(), {String? debugLabel}) → void
Used to listen for updates on a signal but not rebuild the nearest element
listSignal<T>(List<T> list, {String? debugLabel}) ListSignal<T>
Create an ListSignal from List
mapSignal<K, V>(Map<K, V> map, {String? debugLabel}) MapSignal<K, V>
Create an MapSignal from Map
reloadSignalsDevTools() → void
setSignal<T>(Set<T> list, {String? debugLabel}) SetSignal<T>
Create an SetSignal from Set
signal<T>(T value, {String? debugLabel}) Signal<T>
The signal function creates a new signal. A signal is a container for a value that can change over time. You can read a signal's value or subscribe to value updates by accessing its .value property.
signalContainer<T, Arg>(ReadonlySignal<T> create(Arg), {bool cache = false}) SignalContainer<T, Arg, ReadonlySignal<T>>
Create a signal container used to instance signals based on args
streamSignal<T>(Stream<T> stream(), {T? initialValue, bool? cancelOnError, String? debugLabel, void onDone()?}) StreamSignal<T>
timerSignal(Duration every, {String debugLabel = 'Timer', bool? cancelOnError}) TimerSignal
Create a TimerSignal
unlistenSignal<T>(BuildContext context, ReadonlySignal<T> signal, void callback(), {String? debugLabel}) → void
Remove all subscribers for a given signal for watchers
untracked<T>(UntrackedCallback<T> callback) → T
In case when you're receiving a callback that can read some signals, but you don't want to subscribe to them, you can use untracked to prevent any subscriptions from happening.
unwatchSignal<T>(BuildContext context, ReadonlySignal<T> signal) → void
Remove all subscribers for a given signal for watchers
watchSignal<T>(BuildContext context, ReadonlySignal<T> signal, {String? debugLabel}) → T
Watch a signal value and rebuild the context of the Element if mounted and mark it as dirty

Typedefs

AsyncDataBuilder<E, T> = E Function(T value)
Value builder for AsyncState
AsyncErrorBuilder<E> = E Function(Object error, StackTrace? stackTrace)
Error builder for AsyncState
AsyncSignalBuilder<R> = R Function()
Builder on a AsyncSignal callback
AsyncSignalErrorBuilder<R> = R Function(Object? error)
Builder on a AsyncSignal error
AsyncSignalState<T> = AsyncState<T>
AsyncSignalStateData<T> = AsyncData<T>
AsyncSignalStateError<T> = AsyncError<T>
AsyncSignalStateLoading<T> = AsyncLoading<T>
AsyncSignalValueBuilder<R, T> = R Function(T value)
Builder on a successful AsyncSignal value
AsyncStateBuilder<E> = E Function()
Generic builder for AsyncState
EffectCleanup = void Function()
Clean up function to stop subscriptions from updating the callback
TimerSignalEvent = ({int iteration, int millis})
Time event to react to