entityfy_generator 2.1.0
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()
, andtoJson()
methods - π Bidirectional Mapping: Support for both
toEntity()
andtoUiModel()
mapper extensions - βοΈ Flexible Configuration: New
@Entityfy
annotation with boolean flags forgenerateEntity
andgenerateUiModel
- ποΈ 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()
andtoUiModel()
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 theirtoEntity()
methods - List Support: Complete handling of
List<T>
whereT
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
, andanalyzer
- Refactored
mapper_generator.dart
to utilize updated element classes, enhancing compatibility with the new API structure
1.0.0 #
- Initial version.