artifact 1.0.22 copy "artifact: ^1.0.22" to clipboard
artifact: ^1.0.22 copied to clipboard

Data Modeling for the local madman

example/lib/example.dart

import 'package:artifact/artifact.dart';
import 'package:example/gen/artifacts.gen.dart';

@artifact
class MySecureModel {
  final int age;
  final String name;
  final String ssn;
  final String address;

  const MySecureModel({
    this.age = 0,
    this.name = "",
    this.ssn = "",
    this.address = "",
  });
}

void main() {
  $artifactCipher = "derp";

  print(
    MySecureModel(
      name: "Daniel",
      address: "115 Kanter Dr",
      age: 29,
      ssn: "123456789",
    ).toYaml(),
  );
  print("----");
  MySecureModel m = $MySecureModel.fromMap(
    MySecureModel(
      name: "Daniel",
      address: "115 Kanter Dr",
      age: 29,
      ssn: "123456789",
    ).toMap(),
  );

  print("ssn: ${m.ssn}");
  print("address: ${m.address}");
}
0
likes
40
points
612
downloads

Publisher

verified publisherarcane.art

Weekly Downloads

Data Modeling for the local madman

Repository (GitHub)
View/report issues

License

GPL-3.0 (license)

Dependencies

fast_log, json_compress, toml, toon_format, toxic, xml, yaml, yaml_edit

More

Packages that depend on artifact