entityfy_generator 2.0.0 copy "entityfy_generator: ^2.0.0" to clipboard
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(), and toJson() methods
  • πŸ”„ Bidirectional Mapping: Support for both toEntity() and toUiModel() mapper extensions
  • βš™οΈ Flexible Configuration: New @Entityfy annotation with boolean flags for generateEntity and generateUiModel
  • πŸ—οΈ Combined Generator Architecture: Unified code generation in a single file with .entityfy.g.dart extension
  • πŸ” 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() and toUiModel() calls
  • Comprehensive constructor parameter analysis and mapping

Breaking Changes #

  • Replaced multiple individual annotations with unified @Entityfy annotation
  • 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 @EntityMapper by calling their toEntity() methods
  • List Support: Complete handling of List<T> where T is 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, and analyzer
  • Refactored mapper_generator.dart to utilize updated element classes, enhancing compatibility with the new API structure

1.0.0 #

  • Initial version.
0
likes
0
points
18
downloads

Publisher

verified publishercposadadev.com

Weekly Downloads

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.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

analyzer, build, entityfy, source_gen

More

Packages that depend on entityfy_generator