signals_core
library
Classes
AsyncData <T >
State for an AsyncState with a value
AsyncDataRefreshing <T >
A loading state with a value. Signals the query conditions that led to the data
has remained the same and is being refreshed
AsyncDataReloading <T >
A loading state with a value. Signals the query conditions that led to the data
has changed and is being reloaded.
AsyncError <T >
State for an AsyncState with an error
AsyncErrorRefreshing <T >
A loading state with an error. Signal the query conditions that led to the error
has remained the same and is being refreshed.
AsyncErrorReloading <T >
A loading state with an error. Signal the query conditions that led to the error
has changed and is being reloaded.
AsyncLoading <T >
State for an AsyncState with a loading state
AsyncSignal <T >
A Signal is a reactive container for a value that changes over time. It forms the bedrock of the reactive framework, allowing fine-grained, glitch-free propagation of state updates to dependent computeds and effects.
AsyncSignalOptions <T >
Configuration options for an AsyncSignal .
AsyncState <T >
A sealed union representing the lifecycle states of an asynchronous operation.
ChangeSignalOptions <T >
Configuration options for a ChangeStackSignal .
ChangeStackSignal <T >
A reactive Signal that records its history of values, allowing undo and redo operations.
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.
ComputedOptions <T >
Configuration options for a Computed extending signals.ComputedOptions.
Connect <T , S extends T >
A highly powerful connector utility that allows you to dynamically stream and pipe multiple asynchronous streams directly into a single reactive Signal .
DevToolsSignalsObserver
Signals DevTools observer
Effect
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(fn) . By default all updates are lazy, so nothing will update until you access a signal inside effect.
EffectOptions
Configuration options for reactive Effect s extending signals.EffectOptions.
EventSinkSignalMixin <T >
A mixin that implements the standard EventSink interface for a Signal
holding an AsyncState value.
FutureSignal <T >
Future signals can be created by extension or method.
IterableSignal <E >
A reactive Signal that holds an Iterable and implements the Iterable interface.
IterableSignalMixin <E , T extends Iterable <E > >
A mixin that adds reactive Iterable methods and properties to a Signal
holding an Iterable value.
IterableSignalOptions <E >
Configuration options for a IterableSignal .
LinkedSignal <T , S >
A highly powerful, mutable computed signal that derives its default value from an underlying source,
but allows manual write overrides. Crucially, whenever the underlying source value changes, the signal
automatically discards any local manual overrides and resets back to the newly computed default.
LinkedSignalOptions <T , S >
Options for creating a LinkedSignal .
LinkedSignalPreviousState <T , S >
Previous state of a LinkedSignal , containing both the source value
and the computed value from that source version.
ListSignal <E >
A reactive Signal that holds a List and implements the List interface.
ListSignalMixin <E , T extends List <E > >
A mixin that adds reactive List methods and operators to a Signal
holding a List value.
ListSignalOptions <E >
Configuration options for a ListSignal .
LoggingSignalsObserver
Logs all signals and computed changes to the console.
MapSignal <K , V >
A reactive Signal that holds a Map and implements the Map interface.
MapSignalMixin <K , V , T extends Map <K , V > >
A mixin that adds reactive Map methods and operators directly to a Signal .
MapSignalOptions <K , V >
Configuration options for a MapSignal .
PersistedBoolSignal
A PersistedSignal that stores a boolean value.
PersistedDoubleSignal
A PersistedSignal that stores an double value.
PersistedEnumSignal <T extends Enum >
A PersistedSignal that stores an enum value.
PersistedIntSignal
A PersistedSignal that stores an integer value.
PersistedNullableBoolSignal
A PersistedSignal that stores a nullable string value.
PersistedNullableDoubleSignal
A PersistedSignal that stores a nullable double value.
PersistedNullableEnumSignal <T extends Enum >
A PersistedSignal that stores a nullable enum value.
PersistedNullableIntSignal
A PersistedSignal that stores a nullable integer value.
PersistedNullableNumSignal
A PersistedSignal that stores a nullable numeric value.
PersistedNullableStringSignal
A PersistedSignal that stores a nullable string value.
PersistedNumSignal
A PersistedSignal that stores a numeric value.
PersistedSignal <T >
A Signal whose value is persistently stored in a key-value database.
PersistedSignalOptions <T >
Configuration options for a PersistedSignal .
PersistedStringSignal
A PersistedSignal that stores a string value.
QueueSignal <T >
A Signal that holds a Queue .
QueueSignalMixin <T , S extends Queue <T > >
A mixin that adds reactive Queue methods and operations to a Signal
holding a Queue value.
QueueSignalOptions <T >
Configuration options for a QueueSignal .
ReadonlySignal <T >
Read-only signals allow retrieving values but prevent direct mutations or state changes.
ReadonlySignalOptions <T >
Configuration options for a ReadonlySignal extending signals.ReadonlySignalOptions.
SetSignal <E >
A reactive Signal that holds a Set and implements the Set interface.
SetSignalMixin <E , T extends Set <E > >
A mixin that adds reactive Set methods and operations to a Signal
holding a Set value.
SetSignalOptions <E >
Configuration options for a SetSignal .
Signal <T >
Simple writeable signal
SignalContainer <T , Arg , S extends ReadonlySignalMixin <T > >
Signal container used to create signals based on args
SignalModel <T >
A premium wrapper for cohesive state packages constructed with createModel .
SignalModelConstructor <T >
A constructor for models that manages nested effects.
SignalModelOptions
Options for configuring a SignalModel .
SignalOptions <T >
Configuration options for a Signal extending signals.SignalOptions.
SignalsInMemoryKeyValueStore
An in-memory, volatile implementation of SignalsKeyValueStore .
SignalsKeyValueStore
An abstract class defining the persistence adapter contract for PersistedSignal .
SignalsObserver
You can observe all signal values in the dart application by providing an implementation of SignalsObserver:
SinkSignalMixin <T >
A mixin that implements the standard Sink interface for a Signal .
StreamSignal <T >
Stream signals can be created by extension or method.
StreamSignalMixin <T >
A mixin that implements the standard Stream interface for a ReadonlySignal .
TimerSignal
Emit recurring TimerSignalEvent aka AsyncSignal
TrackedSignal <T >
A signal that stores the initial and previous value
TrackedSignalOptions <T >
Configuration options for a TrackedSignal .
Extensions
ActionExt0
on R Function()
Extension on a 0-argument function to wrap it in a type-safe action.
ActionExt1
on R Function(A )
Extension on a 1-argument function to wrap it in a type-safe action.
ActionExt10
on R Function(A , B , C , D , E , F , G , H , I , J )
Extension on a 10-argument function to wrap it in a type-safe action.
ActionExt2
on R Function(A , B )
Extension on a 2-argument function to wrap it in a type-safe action.
ActionExt3
on R Function(A , B , C )
Extension on a 3-argument function to wrap it in a type-safe action.
ActionExt4
on R Function(A , B , C , D )
Extension on a 4-argument function to wrap it in a type-safe action.
ActionExt5
on R Function(A , B , C , D , E )
Extension on a 5-argument function to wrap it in a type-safe action.
ActionExt6
on R Function(A , B , C , D , E , F )
Extension on a 6-argument function to wrap it in a type-safe action.
ActionExt7
on R Function(A , B , C , D , E , F , G )
Extension on a 7-argument function to wrap it in a type-safe action.
ActionExt8
on R Function(A , B , C , D , E , F , G , H )
Extension on an 8-argument function to wrap it in a type-safe action.
ActionExt9
on R Function(A , B , C , D , E , F , G , H , I )
Extension on a 9-argument function to wrap it in a type-safe action.
AsyncSignalState
on Signal <AsyncState <T > >
Extensions for Signal<AsyncState<T>>
BoolSignalExtension
on ReadonlySignal <bool >
Helper extensions for ReadonlySignal<bool> , enabling direct reactive logical conjunction (&), disjunction (|), and exclusive or (^) operations.
ComparableSignalExtension
on ReadonlySignal <T >
Helper extensions for ReadonlySignal<Comparable<T>>
DoubleSignalExtension
on ReadonlySignal <double >
Helper extensions for ReadonlySignal<double> , enabling direct reactive arithmetic and rounding operations on double signals.
EnumSignalExtension
on ReadonlySignal <Enum >
Helper extensions for ReadonlySignal<Enum>
IntSignalExtension
on ReadonlySignal <int >
Helper extensions for ReadonlySignal<int>
ListSignalExtension
on Signal <List <E > >
Helper extensions for Signal<List>
MapSignalExtension
on Signal <Map <K , V > >
Helper extensions for Signal<Map>
NumSignalExtension
on ReadonlySignal <num >
Helper extensions for ReadonlySignal<num> , providing convenient reactive math and comparison operations without needing to manually unwrap .value.
PatternSignalExtension
on ReadonlySignal <Pattern >
Helper extensions for ReadonlySignal<Pattern>
ReadonlyIterableSignalExtension
on ReadonlySignal <Iterable <E > >
Helper extensions for ReadonlySignal<Iterable>
ReadonlyListSignalExtension
on ReadonlySignal <List <E > >
Helper extensions for ReadonlySignal<List>
ReadonlyMapSignalExtension
on ReadonlySignal <Map <K , V > >
Helper extensions for ReadonlySignal<Map>
ReadonlySetSignalExtension
on ReadonlySignal <Set <E > >
Helper extensions for ReadonlySignal<Set<E>> , providing delegators to compute set operations reactively.
ReadonlySignalUtils
on ReadonlySignal <T >
Utility extensions on ReadonlySignal to bridge reactive programming with asynchronous streams and select sub-states.
SetSignalExtension
on Signal <Set <E > >
Helper extensions for Signal<Set<E>> to perform mutation operations that automatically notify downstreams.
SignalBoolExtensions
on bool
Utility extension on bool to easily lift a boolean into a reactive Signal .
SignalComparableExtensions
on Comparable <T >
Extensions for Comparable<T>
SignalDoubleExtensions
on double
Utility extension on double to easily lift a double into a reactive Signal .
SignalEnumExtensions
on T
Extensions for Enum
SignalFunctionExtensions
on T Function()
Utility extension on a getter function T Function() to instantly convert it into a Computed signal.
SignalFutureUtils
on Future <T >
Extension on future to provide helpful methods for signals
SignalIntExtensions
on int
Extensions for int
SignalIterableExtensions
on Iterable <E >
Extensions for Iterable<E>
SignalIterableUtils
on Iterable <T >
Utility extension methods on Iterable to convert them to IterableSignal s.
SignalListExtensions
on List <E >
Extensions for List<E>
SignalListUtils
on List <T >
Utility extension methods on List to convert them to ListSignal s.
SignalMapExtensions
on Map <K , V >
Extensions for Map<E>
SignalMapUtils
on Map <K , V >
Utility extension methods on Map to convert them to MapSignal s.
SignalNumExtensions
on num
Utility extension on num to easily lift a number into a reactive Signal .
SignalPatternExtensions
on Pattern
Extensions for Pattern
SignalQueueUtils
on Queue <T >
Utility extension methods on Queue to convert them to QueueSignal s.
SignalSetExtensions
on Set <E >
Utility extension on Set to easily lift a set into a reactive Signal .
SignalSetUtils
on Set <T >
Utility extension methods on Set to convert them to SetSignal s.
SignalStreamUtils
on Stream <T >
Extension on Stream to provide convenient utilities to convert streams into reactive signals.
SignalStringExtensions
on String
Extensions for String
StringSignalExtension
on ReadonlySignal <String >
Helper extensions for ReadonlySignal<String>
TimerSignalDurationUtils
on Duration
Expose Duration as a TimerSignal
WriteableSignalUtils
on Signal <T >
Utility extensions on Signal providing functional programming wrappers like React-style hooks destructuring.
Properties
onSignalRead
↔ void Function(ReadonlySignal ) ?
Global callback when any signal is read.
getter/setter pair
signalsDevToolsEnabled
↔ bool
Check if the signals devtools are enabled
getter/setter pair
Functions
action (Function fn )
→ Function
Wraps a callback function into a reusable, batched, and untracked action.
action0 <R > (R fn () )
→ R Function()
Wraps a 0-argument callback function in a type-safe action.
action1 <A , R > (R fn (A ) )
→ R Function(A )
Wraps a 1-argument callback function in a type-safe action.
action10 <A , B , C , D , E , F , G , H , I , J , R > (R fn (A , B , C , D , E , F , G , H , I , J ) )
→ R Function(A , B , C , D , E , F , G , H , I , J )
Wraps a 10-argument callback function in a type-safe action.
action2 <A , B , R > (R fn (A , B ) )
→ R Function(A , B )
Wraps a 2-argument callback function in a type-safe action.
action3 <A , B , C , R > (R fn (A , B , C ) )
→ R Function(A , B , C )
Wraps a 3-argument callback function in a type-safe action.
action4 <A , B , C , D , R > (R fn (A , B , C , D ) )
→ R Function(A , B , C , D )
Wraps a 4-argument callback function in a type-safe action.
action5 <A , B , C , D , E , R > (R fn (A , B , C , D , E ) )
→ R Function(A , B , C , D , E )
Wraps a 5-argument callback function in a type-safe action.
action6 <A , B , C , D , E , F , R > (R fn (A , B , C , D , E , F ) )
→ R Function(A , B , C , D , E , F )
Wraps a 6-argument callback function in a type-safe action.
action7 <A , B , C , D , E , F , G , R > (R fn (A , B , C , D , E , F , G ) )
→ R Function(A , B , C , D , E , F , G )
Wraps a 7-argument callback function in a type-safe action.
action8 <A , B , C , D , E , F , G , H , R > (R fn (A , B , C , D , E , F , G , H ) )
→ R Function(A , B , C , D , E , F , G , H )
Wraps an 8-argument callback function in a type-safe action.
action9 <A , B , C , D , E , F , G , H , I , R > (R fn (A , B , C , D , E , F , G , H , I ) )
→ R Function(A , B , C , D , E , F , G , H , I )
Wraps a 9-argument callback function in a type-safe action.
asyncSignal <T > (AsyncState <T > value , {AsyncSignalOptions <T > ? options , String ? debugLabel , bool ? autoDispose })
→ AsyncSignal <T >
Helper function to create an AsyncSignal initialized with an AsyncState .
batch <T > (BatchCallback <T > fn )
→ 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.
changeStack <T > (T value , {int ? limit , ChangeSignalOptions <T > ? options , bool ? autoDispose , String ? debugLabel })
→ ChangeStackSignal <T >
Creates a ChangeStackSignal initialized with the provided value.
computed <T > (T compute (), {ComputedOptions <T > ? options , String ? debugLabel , bool ? autoDispose , bool runCallbackOnListen = false })
→ FlutterComputed <T >
Creates a new FlutterComputed signal that recalculates its value dynamically
based on the signals accessed inside the compute callback.
computedAsync <T > (Future <T > fn (), {AsyncSignalOptions <T > ? options , T? initialValue , List <ReadonlySignal > ? dependencies , bool ? lazy , bool ? autoDispose , String ? debugLabel })
→ FutureSignal <T >
Create an asynchronous computed signal with implicit dependency tracking.
computedContainer <T , Arg > (Computed <T > create (Arg ), {bool cache = false , void onEvict (Arg key , Computed <T > signal )? })
→ SignalContainer <T , Arg , Computed <T > >
Create a signal container for computed signals based on args.
computedFrom <T , A > (List <ReadonlySignal <A > > signals , Future <T > fn (List <A > args ), {AsyncSignalOptions <T > ? options , T? initialValue , bool ? lazy , bool ? autoDispose , String ? debugLabel })
→ FutureSignal <T >
Create an asynchronous computed signal by explicitly declaring its dependencies.
connect <T , S extends T > (Signal <T > signal , [Stream <S > ? stream ])
→ Connect <T , S >
A highly powerful connector utility that allows you to dynamically stream and pipe multiple asynchronous streams directly into a single reactive Signal .
createModel <T > (T factory (), {SignalModelOptions options = const SignalModelOptions() })
→ SignalModelConstructor <T >
Creates a new model constructor with an instanced factory.
disableSignalsDevTools ()
→ void
Disable the devtools
effect (EffectCallback fn , {EffectOptions ? options , bool ? autoDispose , String ? debugLabel , void onDispose ()? })
→ 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(fn) . By default all updates are lazy, so nothing will update until you access a signal inside effect.
futureSignal <T > (Future <T > fn (), {AsyncSignalOptions <T > ? options , T? initialValue , List <ReadonlySignal > ? dependencies , bool ? lazy , bool ? autoDispose , String ? debugLabel })
→ FutureSignal <T >
Future signals can be created by extension or method.
futureSignalContainer <T , Arg > (FutureSignal <T > create (Arg ), {bool cache = false , void onEvict (Arg key , FutureSignal <T > signal )? })
→ SignalContainer <AsyncState <T > , Arg , FutureSignal <T > >
Create a signal container for FutureSignals based on args.
iterableSignal <T > (Iterable <T > iterable , {IterableSignalOptions <T > ? options , bool ? autoDispose , String ? debugLabel })
→ IterableSignal <T >
Creates an IterableSignal holding the provided iterable.
lazySignal <T > ({SignalOptions <T > ? options , String ? debugLabel , bool ? autoDispose , bool runCallbackOnListen = false })
→ FlutterSignal <T >
Creates a lazy, mutable FlutterSignal of type T whose value can be assigned later.
linkedSignal <T , S > (S source (), {LinkedSignalOptions <T , S > ? options })
→ LinkedSignal <T , S >
A highly powerful, mutable computed signal that derives its default value from an underlying source,
but allows manual write overrides. Crucially, whenever the underlying source value changes, the signal
automatically discards any local manual overrides and resets back to the newly computed default.
listSignal <T > (List <T > list , {ListSignalOptions <T > ? options , bool ? autoDispose , String ? debugLabel })
→ ListSignal <T >
Creates a ListSignal initialized with the provided list.
mapSignal <K , V > (Map <K , V > map , {MapSignalOptions <K , V > ? options , bool ? autoDispose , String ? debugLabel })
→ MapSignal <K , V >
Creates a MapSignal initialized with the provided map.
queueSignal <T > (Queue <T > list , {QueueSignalOptions <T > ? options , bool ? autoDispose , String ? debugLabel })
→ QueueSignal <T >
Creates a QueueSignal with the given list (Queue).
readonly <T > (T value , {SignalOptions <T > ? options , String ? debugLabel , bool ? autoDispose , bool runCallbackOnListen = false })
→ FlutterReadonlySignal <T >
Create a new plain readonly signal
readonlySignalContainer <T , Arg > (ReadonlySignal <T > create (Arg ), {bool cache = false , void onEvict (Arg key , ReadonlySignal <T > signal )? })
→ SignalContainer <T , Arg , ReadonlySignal <T > >
Create a signal container used to instance signals based on args
reloadSignalsDevTools ()
→ void
Reload the devtools
setSignal <T > (Set <T > list , {SetSignalOptions <T > ? options , bool ? autoDispose , String ? debugLabel })
→ SetSignal <T >
Creates a SetSignal initialized with the provided set.
signal <T > (T value , {SignalOptions <T > ? options , String ? debugLabel , bool ? autoDispose , bool runCallbackOnListen = false })
→ FlutterSignal <T >
Creates a mutable, reactive FlutterSignal initialized with the given value.
signalContainer <T , Arg > (Signal <T > create (Arg ), {bool cache = false , void onEvict (Arg key , Signal <T > signal )? })
→ SignalContainer <T , Arg , Signal <T > >
Create a signal container used to instance signals based on args
streamSignal <T > (Stream <T > callback (), {AsyncSignalOptions <T > ? options , T? initialValue , List <ReadonlySignal > ? dependencies , void onDone ()?, bool ? cancelOnError , bool ? lazy , bool ? autoDispose , String ? debugLabel })
→ StreamSignal <T >
Stream signals can be created by extension or method.
streamSignalContainer <T , Arg > (StreamSignal <T > create (Arg ), {bool cache = false , void onEvict (Arg key , StreamSignal <T > signal )? })
→ SignalContainer <AsyncState <T > , Arg , StreamSignal <T > >
Create a signal container for StreamSignals based on args.
timerSignal (Duration every , {bool ? cancelOnError , AsyncSignalOptions <TimerSignalEvent > ? options , bool ? autoDispose , String ? debugLabel })
→ TimerSignal
Create a TimerSignal
trackedSignal <T > (T value , {TrackedSignalOptions <T > ? options , bool ? autoDispose , String ? debugLabel })
→ TrackedSignal <T >
Create a signal that stores the initial and previous value
untracked <T > (UntrackedCallback <T > fn )
→ 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.