simple_json 2.1.0 copy "simple_json: ^2.1.0" to clipboard
simple_json: ^2.1.0 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({required this.name});
  final String name;
}
21
likes
0
pub points
35%
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, collection, glob, path, simple_json_mapper, source_gen

More

Packages that depend on simple_json