state library

Reactive state management, locator, and observables from AppForge.

Classes

AppBind<T extends AppController>
Lifecycle-bound widget that automatically registers an AppController on mount, triggers AppController.onReady post-frame, and auto-disposes it when unmounted.
AppBindings
Interface for declaring modular dependencies.
AppBuilder<T extends AppController>
A lightweight manual-update builder bound to an AppController.
AppBuilderState<T extends AppController>
State backing AppBuilder.
AppController
Base controller class with deterministic lifecycle management.
AppLocator
Lightweight, memory-safe dependency injection container.
AppOverride<T>
Typed dependency override entry for AppTestScope.
AppService
Base service class for long-lived, singleton background and core services.
AppTestScope
Scoped widget container that applies overrides on mount and automatically restores prior AppLocator state when disposed.
AppView<T>
Base StatelessWidget with convenient access to a controller registered in AppLocator.
BindingsBuilder
Convenience builder for functional dependency registration.
EvaluationContext
Evaluation context stack for automatic reactive dependency tracking.
Rx<T>
A reactive variable wrapper providing fine-grained, zero-dependency state updates.
RxConsumer
Internal interface for consumers that track reactive dependencies.
RxList<E>
A reactive List that automatically notifies Watch and listeners when mutated.
RxMap<K, V>
A reactive Map that automatically notifies Watch and listeners when mutated.
Rxn<T>
A nullable reactive variable wrapper.
RxNotifier
Common interface for notifiers that report reactive changes.
RxSet<E>
A reactive Set that automatically notifies Watch and listeners when mutated.
RxSubscription
Handle for cancelling an active Rx listener subscription.
UiFailure<T>
The failure state containing error diagnostics and an optional error object.
UiIdle<T>
The initial state before any action is executed.
UiLoading<T>
The loading state while an asynchronous operation is in flight.
UiState<T>
Represents a discrete, type-safe UI state machine.
UiSuccess<T>
The success state containing the payload data.
Watch
A surgical, fine-grained reactive widget.

Extensions

AppIterableExtension on Iterable<E>
Common functional iterable extensions.
AppListExtension on List<E>
Common functional list extensions.
RxBoolExtension on Rx<bool>
Ergonomic extensions on boolean reactive variables.
RxExtension on T
Extension enabling the .obs reactive syntax on any Dart object or value.
RxListExtension on List<E>
Extension enabling .obs on List.
RxMapExtension on Map<K, V>
Extension enabling .obs on Map.
RxSetExtension on Set<E>
Extension enabling .obs on Set.
RxStringExtension on Rx<String>
Ergonomic string forwarding extensions on reactive strings.

Functions

debounce<T>(ValueListenable<T> listener, void callback(T val), {Duration time = const Duration(milliseconds: 800)}) → Worker
Calls callback when listener changes, debounced by time.
ever<T>(ValueListenable<T> listener, void callback(T val)) → Worker
Calls callback every time listener changes.
everAll(List<Listenable> listeners, void callback(dynamic val)) → Worker
Calls callback every time any of the listeners change.
interval<T>(ValueListenable<T> listener, void callback(T val), {Duration time = const Duration(milliseconds: 800)}) → Worker
Calls callback at most once per time duration when listener changes.
once<T>(ValueListenable<T> listener, void callback(T val)) → Worker
Calls callback only the first time listener changes, then auto-cancels.

Typedefs

RxBool = Rx<bool>
RxDouble = Rx<double>
RxInt = Rx<int>
RxnBool = Rxn<bool>
RxnDouble = Rxn<double>
RxnInt = Rxn<int>
RxnString = Rxn<String>
RxString = Rx<String>
Worker = RxSubscription
Alias for an active reactive worker subscription.