entityfy_generator 3.0.1
entityfy_generator: ^3.0.1 copied to clipboard
Code generator for creating extension methods to map model classes to entity classes using annotations.
3.0.1 #
Improved #
- π§ Type Handling: Enhanced field type detection with fallback to parameter type when field is not found in constructor parameters
- π‘οΈ Code Generation Robustness: Improved robustness when handling constructor parameters in edge cases where fields may not be directly accessible
- β‘ Generator Logic: Better type inference for nested models and lists when analyzing constructor parameters
3.0.0 #
Summary #
This major release introduces comprehensive default values support for generated Entity and UI Model classes, along with enhanced type handling and improved code generation quality.
Added #
- βοΈ Default Values Generation: Automatic generation of sensible default values for all constructor parameters in Entity and UI Model classes
- π― Smart Type Detection: Intelligent default value assignment based on type:
- Primitive types:
''for String,0for int,0.0for double,falsefor bool - Collections:
const []for List,const {}for Map - DateTime:
DateTime.now() - Color:
const Color(0xFF000000) - Nullable types:
null - Dynamic types:
null - Custom annotated types: Proper entity/model conversion
- Primitive types:
- π‘οΈ Enhanced Type Safety: Improved handling of dynamic types, Map types, and nullable types
- π Better Code Generation: More robust code generation with comprehensive default value handling for all field types
Improved #
- π§ Type Handling: Enhanced support for dynamic types, Map types, and complex nested structures
- π Code Quality: Improved generated code with proper default value initialization
- π§ͺ Testing: Added comprehensive test suite for default value generation (
default_values_test.dart) - β‘ Generator Performance: Optimized default value detection and assignment logic
Breaking Changes #
- Generated Entity and UI Model classes now include default values for all constructor parameters
- This may affect existing code that relies on required parameters without defaults
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
generateFakeListparameter 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
@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.