sealed_class_creators 1.13.2 copy "sealed_class_creators: ^1.13.2" to clipboard
sealed_class_creators: ^1.13.2 copied to clipboard

Dart and Flutter sealed or union class generator and annotations, with match methods and other utilities.

example/example.dart

import 'result.dart';
import 'weather.dart';

void main() {
  final a = Weather.sunny();
  final b = Weather.rainy(rain: 12);
  final c = Weather.windy(velocity: 1.5, angle: null);

  print(a);
  print(b);
  print(c);

  final d = Result.success(data: 1);
  final e = Result.success(data: 5.6);
  final f = Result.error(exception: 'error');

  print(d);
  print(e);
  print(f);
}
1
likes
140
points
34
downloads

Publisher

verified publisheroriginalautomation.com

Weekly Downloads

Dart and Flutter sealed or union class generator and annotations, with match methods and other utilities.

Homepage
Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

analyzer, build, pub_semver, sealed_class_annotations, sealed_class_writer, source_gen

More

Packages that depend on sealed_class_creators