FLUTTER ECOSYSTEM

injectable

Injectable is a convenient code generator for get_it. Inspired by Angular DI, Guice DI and inject.dart.

Latest version
3.0.0
30-day downloads
260.9K
Likes
1.5K
Pub points
160

Package Overview

Selection guidance generated from public package information. For reference only.

Overview

Injectable is a code generation tool for Flutter that simplifies dependency injection using the get_it service locator. Inspired by Angular, Guice, and inject.dart, it enables clean, type-safe, and maintainable dependency management through annotations. Developers define dependencies with simple decorators, and the generator automatically creates the necessary registration code. This reduces boilerplate and improves code organization, especially in larger applications.

Use cases
  • Large-scale Flutter applications
  • Modular app architecture
  • Testing with mock dependencies
  • Dependency management across multiple environments
  • Streamlining service and repository injection
Key features
  • Automatic dependency registration via code generation
  • Type-safe dependency injection
  • Support for lazy and singleton instances
  • Integration with get_it service locator
  • Easy mocking for unit testing
Suitable for
  • Developers seeking structured dependency management
  • Teams working on complex Flutter projects
  • Projects requiring testability and maintainability
Considerations
  • Requires understanding of code generation and build_runner
  • Additional setup step for build configuration
  • May increase build time slightly
  • Depends on get_it as underlying service locator
Supported platformsAndroidiOSWebmacOSWindowsLinux

Install package

flutter pub add injectable

Categories

Source repository

Related projects

Rankings