entityfy_generator 2.1.0 copy "entityfy_generator: ^2.1.0" to clipboard
entityfy_generator: ^2.1.0 copied to clipboard

Code generator for creating extension methods to map model classes to entity classes using annotations.

2.1.0 #

Summary #

This minor release introduces fake data generation capabilities and copyWith method generation, along with enhanced code generation features and improved package metadata for better developer experience.

Added #

  • πŸ§ͺ Fake Data Generation: New support for generateFakeList parameter to create static mock data methods within Entity classes
  • πŸ”„ CopyWith Methods: Automatic generation of copyWith() methods for both Entity and UI Model classes
  • πŸ“Š Testing Support: Static fakeList(count: int) methods for creating realistic test data with configurable count
  • πŸ”§ Enhanced Generator Logic: Extended generator to handle three boolean configuration flags simultaneously

Improved #

  • πŸ“ Enhanced Documentation: Comprehensive examples showcasing fake data generation and copyWith usage
  • πŸ“¦ Package Metadata: Updated description and metadata for better discoverability on pub.flutter-io.cn
  • 🎯 Code Generation Quality: Improved generated code structure and organization
  • πŸ›‘οΈ Type Safety: Enhanced type handling for complex nested structures in copyWith methods
  • πŸ“š Example Showcase: Updated example project with comprehensive fake data demonstrations

2.0.1 #

Summary #

This patch release focuses on stability improvements, enhanced type safety, and better code generation quality. Includes performance optimizations and bug fixes that improve the overall developer experience when working with the Entityfy generator.

Fixed #

  • πŸ› Null Safety Enhancement: Improved nullable type handling in generated mapper methods
  • πŸ”§ Code Generation Optimization: Enhanced performance of the build process for large projects
  • πŸ“ Better Error Messages: More descriptive error messages during code generation failures
  • 🎯 Type Casting Precision: Refined automatic type casting for complex nested structures

Improved #

  • ⚑ Build Performance: Faster code generation with optimized AST analysis
  • πŸ›‘οΈ Validation Logic: Enhanced validation of input model structures
  • πŸ“š Documentation: Updated inline documentation for generated methods
  • 🧹 Code Quality: Cleaner generated code with improved formatting and organization

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
140
points
78
downloads

Publisher

verified publishercposadadev.com

Weekly Downloads

Code generator for creating extension methods to map model classes to entity classes using annotations.

Repository (GitHub)
View/report issues

Topics

#code-generation #entity-mapping #data-transformation #annotations #source-gen

Documentation

Documentation
API reference

License

MIT (license)

Dependencies

analyzer, build, entityfy, source_gen

More

Packages that depend on entityfy_generator