Overview
zorphy_annotation is a Dart package that provides annotations for code generation within the zorphy ecosystem. It enables developers to define clean, maintainable classes with built-in support for copyWith, JSON serialization, toString, equality checks, and inheritance. By applying simple annotations, developers can automatically generate boilerplate code, reducing errors and improving development speed. The package integrates seamlessly with Flutter and other Dart platforms, making it ideal for managing data models across multiple environments.
Use cases
- Generating immutable data classes
- Automating JSON serialization
- Creating reusable model classes
- Simplifying state management
- Enabling deep copying with copyWith
- Supporting cross-platform app development
Key features
- Automatic copyWith method generation
- Built-in JSON serialization support
- Equality and toString method generation
- Inheritance-aware code generation
- Minimal boilerplate with annotations
- Cross-platform compatibility
Suitable for
- Flutter developers using data models
- Teams prioritizing code cleanliness
- Projects requiring JSON handling
- Apps needing immutable objects
- Developers using code generation tools
- Projects targeting multiple platforms
Considerations
- Requires a code generation build step
- Depends on zorphy's code generator
- May increase build time
- Needs proper annotation setup
- Limited customization without additional configuration
- Best used in conjunction with zorphy_core