flutter_injections 1.0.0-beta copy "flutter_injections: ^1.0.0-beta" to clipboard
flutter_injections: ^1.0.0-beta copied to clipboard

This package helps you manage any dependencies in your project with whithout context and is possible to create dependencies for modules.

Flutter Injections #

This package helps you manage any dependencies in your project with whithout context and is possible to create dependencies for modules. The objective is help any developer to manage dependencies using a easy way for do this.

Learn more #

Used this documentation to improve your knowlegeds about this packages

Features #

  • This package use search-tree to get the dependencies, this improve the velocity to get and use more less CPU to search the specific object.
  • Provide you create a module injections, such as HomeInjections have all dependencies you to need on HomePage.
  • Is easy to use, the focus is keep it simple to create a great application.
  • Auto dispose when you remove the FlutterInjection on your Widget Tree.
  • You can dispose a specific object using __dispose

How to use #

It`s simple, you need three step to add this package

  • add on pubspec.yaml file
   flutter_injections: ^any # or current version
  • Create your FlutterInjections anywhere you to need.
class YourPageInjections extends StatelessWidget {
  const YourPageInjections({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return FlutterInjections(injections: [
      Inject<YourRepository>((i) => YourRepository(client: i.find<Dio>())),
      Inject<YourController>(
          (i) => YourController(repository: i.find<YourRepository>())),
    ], child: const YourPage());
  }
}
  • And get the dependencies is simple. See below
    final controller = FlutterInjections.get<YourController>();
  • So, that's it! Great job for you.
19
likes
0
pub points
15%
popularity

Publisher

verified publishergabul.dev

This package helps you manage any dependencies in your project with whithout context and is possible to create dependencies for modules.

Homepage

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_injections