mvi 2.0.0
mvi: ^2.0.0 copied to clipboard
A Flutter package that applies the MVI architectural pattern to help manage app state and logic in a structured and maintainable way.
2.0.0 #
🚨 BREAKING CHANGES - Complete Architecture Rewrite
This is a major rewrite of the MVI package with significant breaking changes.
New Architecture #
- Replaced signals with ValueListenable: Now uses Flutter's built-in ValueListenable and ValueNotifier for reactive state management
- Dual ViewModel approach:
SimpleViewModelfor basic state management without effectsViewModelfor full MVI pattern with effects support
- New mixins:
SimpleViewModelMixinfor connecting widgets to SimpleViewModelsViewModelMixinfor connecting widgets to ViewModels with effects
- Method rename:
provideViewModel()renamed tocreateViewModel()for better clarity
Migration Guide #
This version is not backward compatible. To migrate:
- Replace
BaseViewModelwith eitherSimpleViewModelorViewModel - Update your mixins to use
SimpleViewModelMixinorViewModelMixin - Rename
provideViewModel()tocreateViewModel() - Replace signals-based state observation with ValueListenableBuilder
Examples #
- Added complete counter example demonstrating basic MVI pattern
- Updated login/posts example with new architecture
1.0.6 #
- Log information about the ViewModel when debugLabel is not null
1.0.5 #
- Simplify code
1.0.4 #
- Add debugLabel property to the view model
- Add debugLabel parameter support to the select method
- Improve the example
1.0.3 #
- Use signals_flutter instead of signals as dependency
- Export Watch from signals_flutter
1.0.2 #
- Add cast method to BaseState
1.0.1 #
- Refactor some code and add more tests.
1.0.0 #
- Initial release.