state_notifier library

Classes

StateNotifier<T>
An observable class that stores a single immutable state.

Mixins

LocatorMixin
A mixin that adds service location capability to an object.

Typedefs

ErrorListener = void Function(Object error, StackTrace? stackTrace)
A callback that can be passed to StateNotifier.onError.
Listener<T> = void Function(T state)
A listener that can be added to a StateNotifier using StateNotifier.addListener.
Locator = T Function<T>()
A function that allows obtaining other objects.
RemoveListener = void Function()
A callback that can be used to remove a listener added with StateNotifier.addListener.

Exceptions / Errors

DependencyNotFoundException<T>
Thrown when tried to call LocatorMixin.read<T>(), but the T was not found.s
StateNotifierListenerError
An error thrown when tried to update the state of a StateNotifier, but at least of the listeners threw.