Skip to main content

zorphy 3.0.0-dev.10 copy "zorphy: ^3.0.0-dev.10" to clipboard
zorphy: ^3.0.0-dev.10 copied to clipboard

A powerful code generation package for Dart/Flutter that provides clean class definitions with copyWith, JSON serialization, toString, equality, and inheritance support

example/lib/main.dart

/// Minimal pub.dev-discoverable example for the `zorphy` package.
///
/// Run with `dart run example/lib/main.dart` from the `zorphy` package root
/// (after `dart run build_runner build` if the generated part is not present).
library;

import 'package:zorphy_annotation/zorphy_annotation.dart';

part 'main.zorphy.dart';

/// A single v3 `@ZorphyEntity` aggregate root.
@ZorphyEntity(principalKey: #id)
abstract class $Task {
  String get id;
  String get title;
  bool get done;
}

void main() {
  final task = Task.fromTrusted(
    id: '1',
    title: 'Ship zorphy 3.0.0',
    done: false,
  );
  final wire = task.toWire();
  final restored = Task.fromWire(wire).getOrThrow();
  print('task: ${restored.title} (done=${restored.done})');
}
0
likes
0
points
16.3k
downloads

Publisher

verified publisherzuraffa.com

Weekly Downloads

A powerful code generation package for Dart/Flutter that provides clean class definitions with copyWith, JSON serialization, toString, equality, and inheritance support

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

analyzer, args, build, code_builder, collection, dart_style, dartx, glob, meta, path, quiver, source_gen, watcher, zorphy_annotation

More

Packages that depend on zorphy