dart_mapper 1.0.1 copy "dart_mapper: ^1.0.1" to clipboard
dart_mapper: ^1.0.1 copied to clipboard

MapStruct-style object mapping for Dart. Define type-safe mappings declaratively with annotations and get generated implementations at compile time via build_runner.

dart_mapper #

MapStruct-style object mapping for Dart. Define type-safe mappings declaratively with annotations and get generated implementations at compile time via build_runner.

pub.dev Docs License: MIT

Features #

  • Standard class mapping with field renaming and ignores
  • Freezed and Built Value support
  • Enum mapping with default and fallback values
  • Multi-source mapping (multiple input parameters per method)
  • Dot notation for nested property access
  • Expression-based computed fields
  • Conditional mapping with fallback values
  • Subclass mapping with Dart 3 pattern matching
  • Default values and constants
  • Callable functions for custom mapping logic
  • Collection support (List, Set, Map, BuiltList, BuiltSet, BuiltMap)
  • Configuration inheritance (@InheritConfiguration, @InheritInverseConfiguration)
  • External mapper injection via uses

Quick Start #

Add the following dependencies to your pubspec.yaml:

dependencies:
  dart_mapper: ^1.0.0

dev_dependencies:
  build_runner: ^2.4.8
  dart_mapper_generator: ^1.0.0

Documentation #

Full documentation, feature guides, and API reference are available at:

https://docs.page/MyLittleSuite/dart_mapper

License #

MIT — see LICENSE.

1
likes
160
points
316
downloads

Documentation

API reference

Publisher

verified publishermylittlesuite.com

Weekly Downloads

MapStruct-style object mapping for Dart. Define type-safe mappings declaratively with annotations and get generated implementations at compile time via build_runner.

Homepage
Repository (GitHub)
View/report issues

Topics

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

License

MIT (license)

More

Packages that depend on dart_mapper