data_classes 3.0.0+1
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
0
pub points
46%
popularity

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

Repository (GitHub)
View/report issues

Documentation

API reference

License

unknown (LICENSE)

Dependencies

meta

More

Packages that depend on data_classes