Skip to main content

json2model 1.1.4 copy "json2model: ^1.1.4" to clipboard
json2model: ^1.1.4 copied to clipboard

This library generates a model object corresponding to a JSON string by executing commands in code.

json2model Pub Version CI #

English | 简体中文

This library generates a model object corresponding to a JSON string by executing commands in code https://pub.dev/packages/json2model

Playground #

Try it online →

The Flutter web playground runs the generator in the browser: paste JSON, get the model, and every result is checked by the Dart parser.

json2model playground demo
Object Nested (dark) Keys that are not identifiers
Invalid JSON Mobile

Run it locally:

cd sample
flutter run -d chrome

Usage #

A simple usage example:

import 'package:json2model/json2model.dart';

void main() {
  run(['--src=example/json', '--dst=example/lib/models']);
}

Feature #

Feature Status
null safety ✅
toJson & fromJson ✅
encoder & decoder ✅
all properties final ✅
all properties optional ✅

Bugs #

Please file feature requests and bugs at the issue tracker.

About #

venshine.cn@gmail.com

Credits #

The playground bundles Space Grotesk and JetBrains Mono, both under the SIL Open Font License 1.1.

License #

BSD 3-clause

6
likes
160
points
794
downloads

Documentation

API reference

Publisher

verified publishervenshine.cn

Weekly Downloads

This library generates a model object corresponding to a JSON string by executing commands in code.

Repository (GitHub)
View/report issues

License

BSD-3-Clause (license)

Dependencies

args

More

Packages that depend on json2model