data_classes 3.0.0+1 copy "data_classes: ^3.0.0+1" to clipboard
data_classes: ^3.0.0+1 copied to clipboard

discontinued

Automatically generates immutable data classes for you based on a mutable "blueprint" class.

example/main.dart

// ignore_for_file: undefined_class, uri_has_not_been_generated

import 'package:data_classes/data_classes.dart';

part 'main.g.dart';

void main() {
  const freshApple = const Fruit(type: 'apple', color: 'green');
  var someApple = freshApple.copy((fruit) => fruit..color = null);
  var kiwi = someApple.copy((fruit) => fruit
    ..type = 'Kiwi'
    ..color = 'brown');
  print(kiwi);
}

@GenerateDataClass()
class MutableFruit {
  String type;

  @nullable
  String color;
}
7
likes
40
points
13
downloads

Publisher

unverified uploader

Weekly Downloads

Automatically generates immutable data classes for you based on a mutable "blueprint" class.

Repository (GitHub)
View/report issues

License

BSD-3-Clause (license)

Dependencies

meta

More

Packages that depend on data_classes