FLUTTER ECOSYSTEM

javiercbk/json_to_dart

Library that generates dart classes from json strings

json_to_dart project cover
Stars
1.3K
Forks
381
Last push (UTC)
Apr 16, 2024
Project status
Archived
Javier Lecuona GitHub avatar
GITHUB User

Javier Lecuona ↗

LanguagesDart

Technical topics

Packages published by this repository

Dependencies used

Dependency list 5 items

Original README

English project snapshot. Visit GitHub for the latest content.

Expand / collapse project README

JSON to Dart

Build Status

Given a JSON string, this library will generate all the necessary Dart classes to parse and generate JSON.

This library is designed to generate Flutter friendly model classes following the flutter's doc recommendation.

Caveats

  • When an empty array is given, it will create a List. Such weird behaviour should warn the user that there is no data to extract.
  • Equal structures are not detected yet (Equal classes are going to be created over and over).
  • Properties named with funky names (like "!breaks", "|breaks", etc) or keyword (like "this", "break", "class", etc) will produce syntax errors.
  • Array of arrays are not supported:
[[{ "isThisSupported": false }]]
[{ "thisSupported": [{ "cool": true }] }]