json_serializable
JSON 转 Dart Model 生成器
粘贴 JSON,编辑字段映射,并实时预览带默认值构造函数的 Dart Model。
JSON 输入
解析 JSON
模型类名
文件基础名
JSON 示例
{ "id": 1, "name": "Sample", "reasonName_zh": "Reason", "score": 9.5, "enabled": true, "tags": ["new", "hot"], "metadata": {"source": "api"}, "items": [{"materialId": 1, "materialName_zh": "材料", "deletedAt": null}], "deletedAt": null }
字段映射
解析 JSON 后会显示保留字段。
JSON 字段名
Dart 属性名
Dart 类型
@JsonKey
暂无解析字段。
Dart 代码预览
复制代码