entityfy_generator 2.0.0
entityfy_generator: ^2.0.0 copied to clipboard
Dart code generator that creates extension methods to map model classes to entity classes using annotations. Simplifies the implementation of toEntity() methods for clean data transformation between layers.
2.0.0 #
Added #
- π― Dual Model Generation: Complete support for generating both Entity classes and UI Model classes from a single annotation
- π Comprehensive Class Generation: Auto-generates complete classes with constructors,
fromJson(), andtoJson()methods - π Bidirectional Mapping: Support for both
toEntity()andtoUiModel()mapper extensions - βοΈ Flexible Configuration: New
@Entityfyannotation with boolean flags forgenerateEntityandgenerateUiModel - ποΈ Combined Generator Architecture: Unified code generation in a single file with
.entityfy.g.dartextension - π Smart Naming Convention: Automatic class naming (
CustomerModelβCustomerEntity+CustomerUiModel) - π Enhanced Type Conversion: Intelligent type mapping for nested models, lists, and complex data structures
- π‘οΈ Type Safety: Full compile-time type checking and validation
Features #
- Sequential generation of Entity classes, UI Model classes, and their respective mappers
- Support for DateTime serialization with ISO8601 format
- Proper nullable type handling throughout the generation process
- Enhanced List type support with element type casting
- Deep nested model support with automatic
toEntity()andtoUiModel()calls - Comprehensive constructor parameter analysis and mapping
Breaking Changes #
- Replaced multiple individual annotations with unified
@Entityfyannotation - Changed file extension from individual generators to combined
.entityfy.g.dart - Updated API to use boolean flags instead of separate annotation classes
1.2.0 #
Added #
- Nested Model Support: Automatic conversion of nested models annotated with
@EntityMapperby calling theirtoEntity()methods - List Support: Complete handling of
List<T>whereTis an annotated model, automatically applying.map((e) => e.toEntity()).toList() - Smart Type Detection: Intelligent differentiation between primitive types, nested models, and lists for appropriate conversion strategies
- Constructor Analysis: Deep examination of entity constructor parameters to ensure correct field mapping
Features #
- Generates clean, readable code with organized extension methods
- Build-time code generation with zero runtime dependencies
- Type-safe mapping with compile-time verification
- Support for complex nested data structures
1.1.0 #
Changed #
- Updated dependencies in pubspec.yaml, aligning with the latest versions of
source_gen,build, andanalyzer - Refactored
mapper_generator.dartto utilize updated element classes, enhancing compatibility with the new API structure
1.0.0 #
- Initial version.