📜  将 json 解析为 dart 模型 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:54.758000             🧑  作者: Mango

代码示例1
import 'dart:convert';

main() {
  String nestedObjText =
      '{"title": "Dart Tutorial", "description": "Way to parse Json", "author": {"name": "bezkoder", "age": 30}}';

  Tutorial tutorial = Tutorial.fromJson(jsonDecode(nestedObjText));

  print(tutorial);