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

Code generator for the omni_mapper package. Automatically generates type-safe object-to-object mapping code with support for field mapping, type converters, default values, list generation, and in-pla [...]

OmniMapper Generator #

pub package License

Code generator for the omni_mapper package.

This package automatically generates type-safe object-to-object mapping code, eliminating boilerplate for converting between DTOs, Models, Entities, and ViewModels.

Installation #

Add this package as a dev_dependency alongside build_runner, and add omni_mapper to your normal dependencies:

dependencies:
  omni_mapper: ^0.1.0

dev_dependencies:
  build_runner: ^2.4.0
  omni_mapper_generator: ^0.1.0

Features #

  • Extension-based mapping — generates clean extension methods on your classes
  • Bidirectional mapping — use target (Model → Entity) or from (Entity → Model)
  • Custom field mapping — rename fields between source and target
  • Type converters — handle type mismatches with OmniConverter
  • Default values — provide fallbacks for missing fields
  • List generation — batch-map iterables automatically
  • In-place updates — mutate existing objects without creating new ones
  • Multi-mapper — map a single class to multiple targets with @OmniMappers

Usage #

For detailed usage instructions and examples, please refer to the omni_mapper package documentation.

Running the Generator #

# One-time build
dart run build_runner build -d

# Watch mode
dart run build_runner watch -d

License #

This project is licensed under the BSD 3-Clause License — see the LICENSE file for details.

1
likes
0
points
133
downloads

Publisher

verified publishermveloso.dev

Weekly Downloads

Code generator for the omni_mapper package. Automatically generates type-safe object-to-object mapping code with support for field mapping, type converters, default values, list generation, and in-place updates.

Repository (GitHub)
View/report issues

Topics

#mapper #code-generation #build-runner #source-gen

License

unknown (license)

Dependencies

analyzer, build, code_builder, omni_mapper, source_gen

More

Packages that depend on omni_mapper_generator