Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://javiercbk.github.io/json_to_dart/
Library that generates dart classes from json strings
https://javiercbk.github.io/json_to_dart/
dart flutter json
Last synced: 2 months ago
JSON representation
Library that generates dart classes from json strings
- Host: GitHub
- URL: https://javiercbk.github.io/json_to_dart/
- Owner: javiercbk
- License: unlicense
- Created: 2018-04-20T04:00:41.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-04-16T09:40:49.000Z (9 months ago)
- Last Synced: 2024-05-20T23:34:10.283Z (8 months ago)
- Topics: dart, flutter, json
- Language: Dart
- Homepage: https://javiercbk.github.io/json_to_dart/
- Size: 2.86 MB
- Stars: 1,308
- Watchers: 23
- Forks: 367
- Open Issues: 37
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# JSON to Dart
[![Build Status](https://travis-ci.org/javiercbk/json_to_dart.svg?branch=master)](https://travis-ci.org/javiercbk/json_to_dart)
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](https://flutter.io/json/#serializing-json-manually-using-dartconvert).
## 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:```json
[[{ "isThisSupported": false }]]
``````json
[{ "thisSupported": [{ "cool": true }] }]
```