microstate library

Classes

Observer<T>
A widget that rebuilds whenever the observed ValueState changes.
ValueState<T>
A reactive state container that wraps a single value and notifies listeners when the value changes.

Extensions

ValueStateExtensions on ValueState<T>
Extension methods for easier state management.

Functions

state<T>(T initialValue, {int maxHistorySize = 10, T validator(T)?}) ValueState<T>
Creates a reactive state container for the given initial value.
stateAsync<T>(T initialValue, {int maxHistorySize = 10, T validator(T)?}) ValueState<T>
Creates a reactive state container for async values.
stateWithHistory<T>(T initialValue, {int maxHistorySize = 10}) ValueState<T>
Creates a reactive state container with history tracking.
stateWithValidation<T>(T initialValue, {required T validator(T), int maxHistorySize = 10}) ValueState<T>
Creates a reactive state container with validation.