smart_mapper_generator 0.1.0 copy "smart_mapper_generator: ^0.1.0" to clipboard
smart_mapper_generator: ^0.1.0 copied to clipboard

Source generator for smart_mapper, including nested collections and ObjectBox ToMany relations.

smart_mapper_generator #

Source generator for the smart_mapper annotations package. It generates constructor-based mappings for Clean Architecture boundaries:

Remote DTO -> Local Model -> Domain Entity

Setup #

Add it as a dev dependency, annotate an abstract mapper, then run:

dependencies:
  smart_mapper: ^0.1.0

dev_dependencies:
  build_runner: ^2.16.0
  smart_mapper_generator: ^0.1.0
dart run build_runner build

Application code should import package:smart_mapper/smart_mapper.dart, not this package directly.

Supported mappings #

  • Same-name constructor fields
  • Explicit field renames with @MapField
  • Freezed factory constructors
  • Nested List and Iterable mappings
  • ObjectBox ToMany relation population
  • Compile-time errors for missing or ambiguous item mappers

See the smart_mapper usage guide for mapper declarations and generated-code examples.

0
likes
140
points
54
downloads

Documentation

API reference

Publisher

verified publisherpinz.dev

Weekly Downloads

Source generator for smart_mapper, including nested collections and ObjectBox ToMany relations.

Repository (GitHub)
View/report issues

Topics

#code-generation #clean-architecture #mapper #objectbox

License

MIT (license)

Dependencies

analyzer, build, smart_mapper, source_gen

More

Packages that depend on smart_mapper_generator