【发布时间】:2021-08-27 03:26:03
【问题描述】:
我正在学习 Flutter。这是我需要调用的字符串,我不知道如何调用这种类型的字符串。
{
"Info":[
{
"c_type_id":"1",
"cleaning type":"Washroom Cleaning"
},
{
"c_type_id":"2",
"cleaning type":"Garden\/Lawn Cleaning"
}
]
}
我的代码
class Album {
final String title;
Album({
this.title,
});
factory Album.fromJson(Map<String, dynamic> json) {
return Album(
title: json['title'],
);
}
}
当我像这样https://flutter.dev/docs/cookbook/networking/fetch-data 关注我的代码时 并收到此错误“必须向文本小部件提供非空字符串”。因为他们遵循这种类型的字符串,而我的字符串类型不同。救命!
{
"userId": 1,
"id": 1,
"title": "quidem molestiae enim"
}
【问题讨论】: