Overview
AutoMappr is a Flutter/Dart code generation package that simplifies object mapping between different classes, reducing boilerplate code. It uses annotations and build-time code generation to automatically create mapping logic, making it easy to transform data models—such as from API responses to domain objects or between DTOs. Ideal for clean architecture, it supports complex mappings with custom logic and null safety. The package integrates seamlessly into Flutter projects via the pub command and works across all major platforms.
Use cases
- Mapping API responses to domain models
- Converting DTOs in clean architecture
- Transforming data between layers
- Simplifying repetitive object copying
- Handling nested object mappings
Key features
- Annotation-based mapping configuration
- Build-time code generation
- Support for custom mapping logic
- Null safety compliant
- Cross-platform compatibility
Suitable for
- Developers using clean architecture
- Teams minimizing boilerplate
- Projects with frequent data model transformations
- Flutter apps with complex data flows
- Apps requiring maintainable mapping logic
Considerations
- Requires build_runner for code generation
- Initial setup needed for annotation processing
- Limited runtime flexibility compared to manual mapping