flutter_zustand library

Classes

Store<V>
Base class for all stores. Holds a state and emits changes whenever set is called.
StoreListener
Registers listeners for multiple stores. The stores do not have to be of the same type.
StoreScope
Provides a StoreLocator instance to its descendants. Descendant widgets observe this changes to the StoreLocator and rebuild accordingly.

Extensions

StoreListenerX on Store<V>
An extension on Store that exposes some helpful utilities for listening to store changes.
StoreSelectorX on Store<V>
Extends the Store class with selector methods that allow you to watch atomic slices of the Store.state.

Functions

create<S extends Store<V>, V>(S create()) → S
Registers a Store factory function with the StoreLocator and returns the Store instance created by the factory. This is a convenience method meant to mirror the API of the original Zustand library.

Typedefs

StoreListenerCallback<V> = void Function(BuildContext context, V state)
A callback that is invoked when a store's Store.state changes.
StoreListenerCondition<V> = bool Function(V previous, V current)
A predicate that determines whether a store's Store.state has changed.