easy_copy_with 4.0.0 copy "easy_copy_with: ^4.0.0" to clipboard
easy_copy_with: ^4.0.0 copied to clipboard

Code generator for automatic copyWith methods in Dart classes using @CopyWith annotation.

Changelog #

4.0.0 - 2026-04-10 #

  • BREAKING: Extracted CopyWith annotation into separate easy_copy_with_annotation package.
    • Replace import 'package:easy_copy_with/annotations.dart' with import 'package:easy_copy_with_annotation/easy_copy_with_annotation.dart'
    • Add easy_copy_with_annotation to dependencies in your pubspec.yaml
    • Move easy_copy_with to dev_dependencies
  • Widened analyzer constraint to >=8.1.1 <11.0.0 for compatibility with freezed, json_serializable, and other generators on analyzer 9.x/10.x.
  • Internal refactor: isolated package:analyzer usage behind an adapter layer. Generated output is identical to 3.3.0.
  • Requires Dart SDK ^3.10.0.

3.3.0 - 2025-12-15 #

  • Added supporting exhaustive checking for sealed classes. Before it was based on factory constructors.
  • Fixed bug for generating classes with inherited fields.
  • Added supporting named constructors.

3.2.2 - 2025-12-12 #

  • Fixed behavior where inherited fields were passed to typedef

3.2.1 - 2025-12-12 #

  • Fixes a crash in the generator when a sealed class contains a non-redirecting factory constructor

3.2.0 - 2025-12-11 #

  • Added generation general fields for sealed classes.

3.1.0 - 2025-11-26 #

  • Added codegen for sealed classes.

3.0.0 #

  • default output now targets .g.dart via a shared part builder, avoiding clashes with other source_gen-based packages like json_serializable
  • documented how to override the extension when a dedicated .copy_with.dart file is preferred
  • restructured the bundled example into a proper library with clear english instructions for running build_runner

2.0.0 #

  • copyWith parameters now preserve the original field types, including generics and nullability
  • sentinel-backed parameters allow assigning null without manual casts
  • packaged runnable example at example/example.dart and updated documentation to match
  • switched licensing references to MIT and ensured generated example outputs ship with the package

1.0.0 #

  • initial release
3
likes
150
points
411
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Code generator for automatic copyWith methods in Dart classes using @CopyWith annotation.

Repository (GitHub)
View/report issues

Topics

#codegen #copy-with #code-generation #source-gen

License

MIT (license)

Dependencies

analyzer, build, easy_copy_with_annotation, source_gen

More

Packages that depend on easy_copy_with