simple_json 0.2.4 copy "simple_json: ^0.2.4" to clipboard
simple_json: ^0.2.4 copied to clipboard

outdated

Simple way to dynamically convert from and to JSON using build-time generators given a type.

example/lib/main.dart

import 'package:simple_json_mapper/simple_json_mapper.dart';
import 'mapper.g.dart' as mapper;

void main() {
  mapper.init();
  // Be sure to run these commands before running this example
  // pub get
  // pub run build_runner build
  final jsonStr = JsonMapper.serialize(Test(name: 'Blah'));
  print('Serialized JSON:');
  print(jsonStr);
  print('\nDeserialized and re-serialized JSON:');
  print(JsonMapper.serialize(JsonMapper.deserialize<Test>(jsonStr)));
}

@JObj()
class Test {
  const Test({this.name});
  final String name;
}
21
likes
0
pub points
40%
popularity

Publisher

unverified uploader

Simple way to dynamically convert from and to JSON using build-time generators given a type.

Homepage
Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

analyzer, build, build_resolvers, glob, path, simple_json_mapper, source_gen

More

Packages that depend on simple_json