objectify 1.0.0 copy "objectify: ^1.0.0" to clipboard
objectify: ^1.0.0 copied to clipboard

Turn any Map into your data object

Objectify #

Turn any Map into your class object

QuickStart #


import "objectify/objectify.dart" as obj;

@Objectify()
class NestedModel {
  String? yay;
  int? nested;
}

@Objectify()
class SomeModel {
  bool? foo;
  String? bar;
  NestedModel nested;
}

void main() {
  final data = {}; // your data
  final model = obj.deserialize<SomeModel>(data);
  // OR
  final model2 = obj.deserialize(data, SomeModel);
  // They are actually the same!
}

NOTICE #

this package uses dart:mirrors, which means you will not be able to use AOT!

0
likes
120
pub points
0%
popularity

Publisher

unverified uploader

Turn any Map into your data object

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

More

Packages that depend on objectify