【发布时间】:2023-04-08 16:21:01
【问题描述】:
我通过 API 请求得到以下字符串:
{
"id": 21,
"description": null,
"creationDate": "2020-01-20T00:00:00",
"status": "string",
"open": false,
"confirmedBy": null,
"solvedDate": "0001-01-01T00:00:00",
"repairedBy": null,
"works": false,
"brokenParts": [],
"wellId": 9
}
现在,我尝试从这里创建一个对象:
var result = json.decode(response.body);
我收到以下错误:
type '_TypeError' is not a subtype of type 'String'
为什么会这样? JSON 有效。
【问题讨论】: