Flutter JSON 序列化
原名:flutter-implement-json-serialization
为简单模型实现可读、可测试的 fromJson 和 toJson 数据转换。
中文 Skills 技能说明
适合字段不多、无需代码生成的 API 数据结构。技能会明确可空字段、类型转换和未知值处理,不凭空补齐服务端数据;接口含用户或企业信息时要使用脱敏样本,完成后补充往返和异常输入测试。
上游能力依据
上游原始适用说明:Create model classes with fromJson and toJson methods using dart:convert. Use when manually mapping JSON keys to class properties for simple data structures.
上游 SKILL.md 主要章节(保留原文标题):
- Contents
- Core Guidelines
- Workflow: Implementing a Serializable Model
- Workflow: Fetching and Parsing JSON
- Examples
- High-Fidelity Model Implementation
- Synchronous Parsing (Small Payload)
- Background Parsing (Large Payload)
使用边界
先读取项目约定、依赖版本和现有测试,再提出最小改动。写文件、运行脚本、提交代码或发布前应检查差异并保留回退路径。
作者、翻译与许可证
- 原作者
- The Flutter Authors 与 flutter/agent-plugins contributors
- 中文翻译
- CEOFans翻译
- 许可证
- BSD-3-Clause
- 上游来源
- https://github.com/flutter/agent-plugins/tree/864cf8797b190ddb81e4875db6dd6bab89641f62/skills/flutter-implement-json-serialization
适用范围
平台:linux、macos、windows;标签:软件开发、Flutter JSON 序列化
安全提示
基础静态扫描不等于绝对安全。技能可能调用命令、浏览器、云服务或本地文件,请在最小权限环境中使用,高风险操作必须人工确认。
如发现侵权、许可证或安全问题,可在本页前台提交投诉,管理员复核后可立即下架。