ioc_widget 2.0.0
ioc_widget: ^2.0.0 copied to clipboard
A simple, flexible, and testable dependency injection (DI) solution for Flutter, inspired by the best of both the Provider and get_it packages. Supports widget-level DI, transient and singleton strate [...]
2.0.0 #
Breaking Changes #
- Renamed
IocConsumerwidget toInjectScopedDependencyfor clarity and to avoid confusion with Provider's Consumer. - Updated all references in the codebase, example app, and tests to use
InjectScopedDependency. - Updated documentation and API references accordingly.
- Added
InjectScopedNotifier<T extends ChangeNotifier>widget for scoped injection of ChangeNotifier.- Automatically rebuilds child widgets when the notifier calls
notifyListeners. - Disposes the notifier when the widget is removed from the tree.
- Ensures the injected notifier is a singleton within the widget scope and changes when the widget is disposed/recreated.
- Automatically rebuilds child widgets when the notifier calls
- Example app updated with a new page demonstrating
InjectScopedNotifierusage and singleton behavior. - Comprehensive widget tests for
InjectScopedNotifier, covering rebuilds, disposal, singleton scope, and instance recreation.
1.0.0 #
Added #
- Initial release of ioc_widget package.
- InjectableWidget for transient dependencies.
- LazySingletonWidget for lazy singleton dependencies.
- MultiIocWidget for grouping multiple dependencies.
- IocConsumer for scoped dependency access in builder context.
- context.get
- Example app demonstrating navigation and all features.
- Comprehensive widget tests for all DI scenarios.
- MIT License file added.
- Complete README documentation and usage guide.