json_dart_generator 0.9.5+4 copy "json_dart_generator: ^0.9.5+4" to clipboard
json_dart_generator: ^0.9.5+4 copied to clipboard

outdated

Convert json data to dart class, Support multiple formats(root is array / multiple array etc).

example/example.dart

import 'package:json_dart_generator/json_dart_generator.dart';

void main(List<String> args) {
  var jsonText = '''
[
  [
    {
      "aa": "cc",
      "bb": true,
      "cc": {
        "ilis": [
          10,
          20,
          30.0
        ]
      }
    }
  ]
]
  ''';

  var generator = DartCodeGenerator(
    rootClassName: 'Root', // root class name
    rootClassNameWithPrefixSuffix: true, // root class name include classPrefix / classSuffix
    classPrefix: 'Hi', // class name prefix
    classSuffix: 'Go', // class name suffix
  );

  // call generate to generate code
  var code = generator.generate(jsonText);
  print(code);
}
2
likes
40
pub points
47%
popularity

Publisher

unverified uploader

Convert json data to dart class, Support multiple formats(root is array / multiple array etc).

Repository (GitHub)
View/report issues

License

BSD-3-Clause (license)

Dependencies

args, dart_style

More

Packages that depend on json_dart_generator