custom_mapper_annotation 0.0.3
custom_mapper_annotation: ^0.0.3 copied to clipboard
Annotations for custom_mapper code generation package.
0.0.2 #
Bug Fixes #
- Platform Support: Added explicit platform support declarations for all platforms (Android, iOS, Windows, macOS, Linux, Web)
0.0.1 #
Initial Release #
Custom Mapper Annotation - Lightweight annotations package for the custom_mapper code generation framework.
π¦ Annotations
-
@Mapper(domain: Type, toDomain: bool, toData: bool)- Core annotation for generating type-safe mappers between domain objects and DTOsdomain: Target domain class to map to/fromtoDomain: GeneratetoDomain()method (default: true)toData: GeneratetoData()method (default: false)
-
@IgnoreField()- Skip specific fields during mapping (planned for future releases) -
@DefaultIfNull(value)- Provide default values for null fields (planned for future releases)
β¨ Features
- Zero Dependencies: Lightweight package with no external dependencies
- Null Safety: Full support for Dart's null safety features
- Type Safety: Compile-time type checking for all annotations
- Framework Integration: Seamless integration with freezed, json_annotation, and other packages
π Usage
import 'package:custom_mapper_annotation/custom_mapper_annotation.dart';
@Mapper(domain: User, toDomain: true, toData: true)
sealed class UserDto {
// Your DTO implementation
}
π Related Packages
custom_mapper- Main code generation engine that uses these annotations