# copy_with_extension

> Generates type-safe copyWith extensions for Dart classes

Source: https://talira.ai/catalog/copy-with-extension-perjthk3
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [developer tools / code generation](https://talira.ai/categories/developer-tools/code-generation), [languages / dart](https://talira.ai/categories/languages/dart)
- Licence: MIT[^1]
- Pricing: Free and open source[^1]
- Free tier: yes[^1]
- Backed by: [Alexander Kirsch](https://talira.ai/orgs/numen31337.md)

copy_with_extension generates type-safe `copyWith` extensions for [Dart](https://talira.ai/catalog/dart-3askvstd.md) classes and record typedefs annotated with `@CopyWith()`, through a [build_runner](https://talira.ai/catalog/build-runner-snjaeg1d.md) builder (copy_with_extension_gen). The generated API copies immutable objects while changing one field (`copyWith.fieldName(...)`), several at once (`copyWith(...)`) or setting fields to null (`copyWithNull`).

## Links

- GitHub: https://github.com/numen31337/copy_with_extension

## Problems it solves

- generate copyWith methods for immutable Dart classes
- update one field of an immutable Flutter state object
- avoid writing copyWith by hand in Dart

## Features

- @CopyWith annotation for classes and record typedefs
- field-by-field and multi-field copyWith
- copyWithNull to clear fields
- build_runner code generation

## Trust

Overall: 0.40 out of 1.
Signals: maintenance 0.64, adoption 0.39, momentum 0.09, community 0.45, backing 0.30, extensibility 0.00.

- last commit 14 days ago
- 6 commits in the last 90 days
- latest release 18.0.1 14 days ago
- 86 GitHub stars
- 12 contributors
- backed by Alexander Kirsch

## Related

- Works with [build_runner](https://talira.ai/catalog/build-runner-snjaeg1d.md)

## Alternatives

- [code_builder](https://talira.ai/catalog/code-builder-bg87ba03.md): A fluent, builder-based library for generating valid Dart code

## Sources

[^1]: https://github.com/numen31337/copy_with_extension/blob/main/LICENSE (checked 29 Nov 2026)
