FLUTTER ECOSYSTEM

inject_generator

Source code generator for inject_annotation. Reads @inject, @component, and @module annotations and generates fully wired dependency components at build time.

Latest version
1.2.1
30-day downloads
59.5K
Likes
6
Pub points
140

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

Overview

Inject_generator is a build-time source code generator for the inject_annotation package, enabling dependency injection in Flutter and Dart applications. It processes annotations like @inject, @component, and @module to automatically generate fully wired dependency components, reducing boilerplate and improving compile-time safety. By generating code during the build process, it ensures efficient and type-safe dependency resolution without runtime overhead. The tool integrates seamlessly with Flutter and supports multiple platforms including Android, iOS, Linux, macOS, and Windows.

Use cases
  • Automating dependency injection setup
  • Reducing manual wiring of dependencies
  • Enabling compile-time dependency validation
  • Streamlining large-scale app architecture
  • Supporting modular application design
Key features
  • Build-time code generation
  • Compile-time dependency safety
  • Minimal runtime overhead
  • Support for @inject, @component, and @module
  • Seamless integration with inject_annotation
Suitable for
  • Large Flutter/Dart projects
  • Teams prioritizing maintainability
  • Applications using dependency injection patterns
  • Developers avoiding runtime reflection
  • Projects requiring type-safe DI
Considerations
  • Requires build_runner to be set up
  • Needs proper annotation usage
  • Generated code must be committed or regenerated on each build
  • Limited to static dependency graphs
  • Not suitable for dynamic dependency resolution
Supported platformsAndroidiOSLinuxmacOSWindows

Install package

flutter pub add inject_generator

Categories

Dependencies

Dependency list 14 items

Source repository

Related projects

No data available yet.

Rankings