mint 0.4.0 copy "mint: ^0.4.0" to clipboard
mint: ^0.4.0 copied to clipboard

outdated

Code generation framework with support for copyWith, copyJar, equality, and JsonSerializable (fromJson, toJson).

example/lib/main.dart

import 'package:au/au.dart';
import 'package:example/models/person.dart';

void main() {
  final p1 = const Person('John', 35);

  final p2 = p1.copyWith(
    age: const AuValue<int>(25),
  );

  assert(p1 != p2);

  // or just copy the jar
  final p3 = p1.copyJar(const AuPersonJar(
    age: 21,
    name: 'Joe',
  ));

  final p4 = AuPerson.fromJson(p3.toJson());

  assert(p3 == p4);

  final p5 = const AuPerson('John', 35);
  assert(p5 == p1);
}
3
likes
0
pub points
0%
popularity

Publisher

verified publishertypical.day

Code generation framework with support for copyWith, copyJar, equality, and JsonSerializable (fromJson, toJson).

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

analyzer, au, build, glob, json_annotation, json_serializable, mustache_template, path, source_gen

More

Packages that depend on mint