mu_state 2.0.0+4
mu_state: ^2.0.0+4 copied to clipboard
Minimal Cubit-inspired state management using Flutter's built-in primitives. No external dependencies.
2.0.0+4 #
- Add screenshots
2.0.0+1 #
- Improved documentation and examples
2.0.0 #
New Features #
- Added
MuListener<S>- Perform side effects in response to state changes (navigation, dialogs, etc.) - Added
MuMultiListener- Listen to multiple state changes with a single widget - Added
MuConsumer<S>- CombinesMuBuilderandMuListenerfunctionality - Enhanced
MuProvider<T>- Now fully generic, works with any type (not just logic classes) - Improved documentation - Comprehensive README with better examples and usage patterns
Breaking Changes #
MuProvider<T>is now generic for any type instead ofMuProvider<L, S>- Constructor parameter renamed from
logictovalueto reflect generic nature
Improvements #
- Auto-disposal -
MuProviderautomatically disposesChangeNotifierinstances
Architecture #
This release represents the mature, stable API for mu_state. The complete widget set now provides:
- State management with
MuLogic<S>andMuBuilder<S> - Side effects with
MuListener<S>andMuConsumer<S> - Dependency injection with generic
MuProvider<T> - Multi-state handling with
MuMultiBuilderandMuMultiListener
1.1.0 #
- Added
MuMultiProvider- Clean nesting of multiple providers - Enhanced example - Login feature with MuMultiProvider and repository pattern
- Documentation improvements - Better README structure
1.0.0 #
New Features #
MuLogic<T>- Renamed fromMuStatefor clarity (still an alias forValueNotifier)MuProvider<L, S>- Provides logic instances to widget tree usingInheritedWidgetcontext.logic<T>()extension - Easy access to logic from contextMuComparablemixin - Lightweight alternative to Equatable for state equality
Breaking Changes #
- RENAMED:
MuState→MuLogic<T>for better clarity - REMOVED: Pre-defined state classes (
MuEvent,MuLoading,MuError,MuData) - Users now define their own immutable state classes with
MuComparable
Architecture #
- Encouraging Cubit-style pattern: one logic class per page/feature
- Custom state classes instead of pre-defined ones
Unchanged #
MuBuilder<T>- Still an alias forValueListenableBuilderMuMultiBuilder- Listen to multipleValueNotifierobjects
Migration Guide #
- Replace
MuStatewithMuLogic<T> - Replace
MuEvent<T>usage with custom state classes - Use
MuProviderandcontext.logic<T>()for dependency injection - Add
MuComparablemixin to state classes for equality comparison
0.5.0 #
- let's keep the old names to avoid breaking changes (except for events!)
- note
MuStateis just an alias forValueNotifierand can take any type - note
MuBuilderis just an alias forValueListenableBuilder - note
MuEventis optional
0.4.0 #
- renamed
MuStatetoMuLogic!BREAKING! - renamed
MuEventtoMuState!BREAKING! MuLogicis now just an alias forValueNotifierand can take any type (MuStateis optional)MuBuilderis now just an alias forValueListenableBuilder
0.3.0 #
- use explicit type for MuEvent
0.2.0 #
- replace complex mu_event type with 4 sealed types (BREAKING)
- use switch expression / patterns to handle mu_event types
- bump sdk version to 3.0.0
0.1.1 #
- update CHANGELOG
0.1.0 #
- user super in constructors
- update lints -> 3.0.1
- sdk env 2.18.0 < 4.0.0
- add vscode example launcher
0.0.4 #
- replace AnimatedBuilder -> ListenableBuilder
- Set min SDK version to 3.0.0 and Flutter to 3.10.0
0.0.3+1 #
- Add widget tests and improve unit tests
- Improve example in README
0.0.3 #
- Remove duplicate MuBuilder declaration
0.0.2 #
- Split classes into separate files under lib/src
0.0.1 #
- Initial release