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

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
120
pub points
44%
popularity

Publisher

unverified uploader

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

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

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

More

Packages that depend on simple_json