mutable_copy_generator 0.2.6

  • Readme
  • Changelog
  • Example
  • Installing
  • 60

mutable_copy_generator #

MutableCopy simplify copy of immutable object. Unlike CopyWith allow to set null value

Code generation #

Code generator for mutable_copy

import 'package:mutable_copy/mutable_copy.dart';


part 'employe.g.dart';

@imutable
@MutableCopy
class Employe {
  final String fullName;
  final String department;
  final String team;

  Employe({
    this.fullName,
    this.department,
    this.team,
  });
}

Add dependencies #

dependencies:
  ...
  mutable_copy: ^0.2.5

dev_dependencies:
  ...
  mutable_copy_generator: ^0.26
  build_runner: ^1.9.0

Generate code #

flutter pub run build_runner build

Udage #

final e1 = Employe(
  fullName: 'Max Hatson',
  department: 'Mobile',
  team: 'Flutter',
);
final eMutable = e1.copy((o) => o..fullName = 'Bob Watson');

0.2.6 #

  • Critical fix

0.2.5 #

  • Update Readme

0.2.4 #

  • Update readme

0.2.3 #

  • Fix dependencies

0.2.2 #

  • Update readme

0.2.1 #

  • Fix dependencies

0.2.0 #

  • Add code generator support

example/example.dart

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

part 'example.g.dart';

@immutable
@MutableCopy()
class SimpleObject {
  final String id;
  final int value;

  SimpleObject({this.id, this.value});
}

Use this package as a library

1. Depend on it

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


dependencies:
  mutable_copy_generator: ^0.2.6

2. Install it

You can install packages from the command line:

with pub:


$ pub get

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

3. Import it

Now in your Dart code, you can use:


import 'package:mutable_copy_generator/mutable_copy_generator.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
21
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
60
Learn more about scoring.

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

  • Dart: 2.8.4
  • pana: 0.13.13

Analysis suggestions

Package not compatible with SDK flutter

Because it is not compatible with any of the supported runtimes: flutter-native, flutter-web

Package not compatible with runtime flutter-native on android

Because of the import of dart:mirrors via the import chain package:mutable_copy_generator/mutable_copy_generator.dartpackage:source_gen/source_gen.dartpackage:source_gen/src/type_checker.dartdart:mirrors

Package not compatible with runtime flutter-native on ios

Because of the import of dart:mirrors via the import chain package:mutable_copy_generator/mutable_copy_generator.dartpackage:source_gen/source_gen.dartpackage:source_gen/src/type_checker.dartdart:mirrors

Package not compatible with runtime flutter-native on linux

Because of the import of dart:mirrors via the import chain package:mutable_copy_generator/mutable_copy_generator.dartpackage:source_gen/source_gen.dartpackage:source_gen/src/type_checker.dartdart:mirrors

Package not compatible with runtime flutter-native on macos

Because of the import of dart:mirrors via the import chain package:mutable_copy_generator/mutable_copy_generator.dartpackage:source_gen/source_gen.dartpackage:source_gen/src/type_checker.dartdart:mirrors

Package not compatible with runtime flutter-native on windows

Because of the import of dart:mirrors via the import chain package:mutable_copy_generator/mutable_copy_generator.dartpackage:source_gen/source_gen.dartpackage:source_gen/src/type_checker.dartdart:mirrors

Package not compatible with runtime flutter-web on web

Because of the import of dart:io via the import chain package:mutable_copy_generator/mutable_copy_generator.dartpackage:source_gen/source_gen.dartpackage:source_gen/src/utils.dartpackage:build/build.dartpackage:build/src/generate/run_post_process_builder.dartpackage:build/src/builder/post_process_builder.dartpackage:build/src/builder/builder.dartpackage:build/src/builder/build_step.dartpackage:build/src/asset/reader.dartpackage:glob/glob.dartpackage:glob/src/list_tree.dartpackage:glob/src/io.dartpackage:glob/src/io_export.dartdart:io

Package not compatible with runtime native-aot

Because of the import of dart:mirrors via the import chain package:mutable_copy_generator/mutable_copy_generator.dartpackage:source_gen/source_gen.dartpackage:source_gen/src/type_checker.dartdart:mirrors

Package not compatible with runtime web

Because of the import of dart:io via the import chain package:mutable_copy_generator/mutable_copy_generator.dartpackage:source_gen/source_gen.dartpackage:source_gen/src/utils.dartpackage:build/build.dartpackage:build/src/generate/run_post_process_builder.dartpackage:build/src/builder/post_process_builder.dartpackage:build/src/builder/builder.dartpackage:build/src/builder/build_step.dartpackage:build/src/asset/reader.dartpackage:glob/glob.dartpackage:glob/src/list_tree.dartpackage:glob/src/io.dartpackage:glob/src/io_export.dartdart:io

Health issues and suggestions

Document public APIs. (-1 points)

2 out of 2 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.6.0 <3.0.0
analyzer >=0.39.0 <1.0.0 0.39.11
build ^1.2.2 1.3.0
mutable_copy ^0.2.4 0.2.5
path ^1.6.4 1.7.0
source_gen ^0.9.5 0.9.5
Transitive dependencies
_fe_analyzer_shared 5.0.0
args 1.6.0
async 2.4.1
charcode 1.1.3
collection 1.14.13
convert 2.1.1
crypto 2.1.5
csslib 0.16.1
dart_style 1.3.6
glob 1.2.0
html 0.14.0+3
js 0.6.2
logging 0.11.4
meta 1.1.8
node_interop 1.1.1
node_io 1.1.1
package_config 1.9.3
pedantic 1.9.0 1.9.1
pub_semver 1.4.4
source_span 1.7.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.2.0
watcher 0.9.7+15
yaml 2.2.1
Dev dependencies
build_config ^0.4.2
build_runner ^1.9.0