mvvm_kit 0.13.0
mvvm_kit: ^0.13.0 copied to clipboard
A lightweight MVVM pattern implementation with LiveData for reactive state management in Flutter applications.
0.13.0 #
Features #
- ViewWidget: Introduced
ViewWidgetas a simplified alternative toViewStatefor common use cases.- Streamlined API with just
build()and optionalonInit()methods - Automatic ViewModel lifecycle management (initialization and disposal)
- Automatic LiveData scope cleanup when widget is disposed
- Enables Cascade State Composition (CSC) pattern where each widget maintains isolated state while reactively injecting data to children via constructor props
- Override
resolveViewModel()for custom ViewModel injection (useful for testing)
- Streamlined API with just
Documentation #
- Added comprehensive documentation for ViewWidget
- Updated
ViewStatedocumentation to clarify when to use it vsViewWidget - Improved README with examples of both
ViewWidgetandViewStateusage
Refactor #
- Renamed
debugLogparameter fromifTruetoconditionfor better clarity
0.12.0 #
Performance #
- LiveData: Changed default change detection from
DeepCollectionEquality(O(N)) to simple equality!=(O(1)). This significantly improves performance for large collections. - GroupWatch: Implemented microtask debouncing to prevent multiple rebuilds when multiple notifiers change in the same frame.
Breaking Changes #
- LiveData: Assigning the same instance of a mutable object (e.g.,
List,Map) to aMutableLiveDatawill NO LONGER trigger a notification by default, even if the content changed.- Migration: Use
.update()for in-place modifications or create a new instance of the collection.
- Migration: Use
Dependencies #
- Removed
package:collectiondependency.
0.11.0 #
Breaking Changes #
registerSingletonnow requires an instance instead of a factory function.- Factory functions in Service Locator now has a injection parameter: a function to get dependencies by type. This allows inject dependencies more easily.
0.10.1 #
Refactor #
Breaking Changes
- Updated ViewState to use resolveViewModel() method for ViewModel retrieval.
Other
- Updated README documentation to reflect changes in ViewState for ViewModel injection strategy.
- Updated documentation for Service Locator.
0.9.1 #
Docs #
- Added version badge to README.md and API documentation index.html for better visibility of the current package version.
0.9.0 #
Breaking Changes #
- Changed default ViewModel creation strategy in ViewState to use createViewModel() method. This allows easier integration with different dependency injection strategies.
Service Locator #
- Added a minimalist built-in service locator
SLfor registering and retrieving ViewModel instances or other dependencies. - Updated README documentation to include examples of using the built-in service locator.
Other Improvements #
- Updated example views to demonstrate different ViewModel injection strategies using the built-in service locator, Provider, and GetIt.
- Improved code comments and documentation for better clarity on ViewModel management and dependency injection.
- Added tests for ViewModel, RepositoryData, and HotswapLiveData.
0.8.1 #
- Fixed typos in ViewModel documentation comments
- Removed deprecated parameters from RepositoryData transform method
- Updated RepositoryData tests to remove deprecated parameters
- Formatted files for consistency
0.8.0 #
- Initial release of mvvm_kit
- LiveData implementation for reactive state management
- MutableLiveData for mutable observable data
- HotswapLiveData for dynamic data source switching
- ViewModel base class with lifecycle management
- ViewState for connecting views to ViewModels
- Watch and GroupWatch widgets for observing LiveData changes
- DataScope for automatic resource management and disposal
- LiveData transformations: transform, filter, mirror
- RepositoryData pattern for data layer integration
- Comprehensive documentation and examples