json_to_dart_class 1.2.0
json_to_dart_class: ^1.2.0 copied to clipboard
This Dart package, **json_to_dart_class**, facilitates the generation of Dart class files from JSON data. It provides a convenient way to convert JSON structures into corresponding Dart classes, makin [...]
example/json_to_dart_class_example.dart
import 'package:json_to_dart_class/json_to_dart_class.dart';
void main() async {
var json = {
"status": "success",
"age": 32,
"feed": {
"len": 10,
"wd": "Sunny",
"speed": 25.0,
"location": {
"address": "123 Main Street",
"postal_code": "12345",
"city": "Miami",
},
"childs": [
{
"name": "Emily",
"age": 8
},
{
"name": "David",
"age": 5
},
{
"name": "Sarah",
"age": 12
}
]
}
};
await jsonToDart(
json: json,
className: 'persson',
library: 'persson',
folderPath: 'src/persson');
}