microstate 1.0.1
microstate: ^1.0.1 copied to clipboard
A lightweight, reactive state management solution for Flutter applications with built-in history tracking, validation, debouncing, and throttling capabilities.
Changelog #
1.0.1 - 2024-08-07 #
- Updated ReadMe & pubspec.yaml file
- Added an example
1.0.0 - 2025-08-07 #
Added #
- Initial release of microstate package
ValueState<T>
class for reactive state managementstate()
function for creating basic state containersstateWithHistory()
function for state with undo/redo capabilitiesstateWithValidation()
function for state with validationstateAsync()
function for async state managementObserver<T>
widget for automatic UI updates- Built-in debouncing and throttling capabilities
- History tracking with configurable max history size
- Extension methods for common operations (increment, decrement, toggle)
- Type-safe API with full generic support
- Comprehensive test coverage
- Example application demonstrating usage
Features #
- Reactive State Management: Automatic UI updates when state changes
- History Tracking: Built-in undo/redo functionality with configurable history size
- Validation: Optional value validation before state updates
- Debouncing: Control update frequency for frequent changes
- Throttling: Limit update frequency for high-frequency events
- Widget Integration: Seamless integration with Flutter widgets via Observer
- Type Safety: Full type safety with generics
- Lightweight: Minimal overhead and dependencies
Technical Details #
- Extends
ChangeNotifier
for Flutter integration - Uses
Timer
for debouncing and throttling - Implements proper disposal to prevent memory leaks
- Provides unmodifiable history access
- Supports async operations
- Includes comprehensive documentation and examples