ioc_widget 2.0.0 copy "ioc_widget: ^2.0.0" to clipboard
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 IocConsumer widget to InjectScopedDependency for 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.
  • Example app updated with a new page demonstrating InjectScopedNotifier usage 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.
0
likes
0
points
554
downloads

Publisher

unverified uploader

Weekly Downloads

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 strategies, and is ideal for scalable, testable, and maintainable Flutter apps.

Homepage

License

unknown (license)

Dependencies

flutter

More

Packages that depend on ioc_widget