Overview
modular_codegen is a code generation package for FlutterModular that automates dependency injection and route parameter handling. It uses annotations like @Inject, @Param, and @Data to generate boilerplate code, reducing manual setup and improving type safety. This enhances development speed and maintainability in modular Flutter applications. The package integrates seamlessly with the FlutterModular ecosystem, enabling efficient navigation and service injection across modules.
Use cases
- Automating dependency injection in modular Flutter apps
- Generating route parameters with @Param annotation
- Simplifying service and controller injection
- Reducing boilerplate in large-scale Flutter projects
- Enabling type-safe navigation between modules
Key features
- Annotation-based code generation
- Support for @Inject, @Param, and @Data
- Seamless integration with FlutterModular
- Reduces manual boilerplate
- Improves type safety and performance
Suitable for
- Developers using FlutterModular for large apps
- Teams prioritizing maintainable architecture
- Projects requiring automated dependency injection
- Apps with complex routing needs
- Developers seeking reduced boilerplate
Considerations
- Requires FlutterModular as a dependency
- Needs build_runner for code generation
- Limited to Dart/Flutter environment
- May increase build time slightly
- Requires understanding of annotations and modular patterns