copy_with_extension 1.0.7

  • Readme
  • Changelog
  • Example
  • Installing
  • 92

Pub Package

Defines the annotation used by copy_with_extension_gen to generate copyWith extensions.

For more info on this package check out my blog article.

1.0.7 Extension name fix #

  • Creates a unique extension name for each class.

1.0.6 Minor corrections #

  • Minor metadata and description corractions.

1.0.0 Initial release #

  • Lets you annotate an object using @CopyWith() to generate a copyWith extension.


import 'package:meta/meta.dart' show immutable;
import 'package:copy_with_extension/copy_with_extension.dart';

/// Make sure that `part` is specified, even before launching the builder
part 'example.g.dart';

class SimpleObject {
  final String id;
  final int value;

  /// Make sure that constructor has named parameters (wrapped in curly braces)
  SimpleObject({, this.value});

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  copy_with_extension: ^1.0.7

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:copy_with_extension/copy_with_extension.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Feb 27, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.5


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.0 <3.0.0
Dev dependencies
build_runner >=1.0.0 <2.0.0
copy_with_extension_gen >=1.0.0 <2.0.0
test <2.0.0