【发布时间】:2021-02-12 14:48:14
【问题描述】:
大家好,我想问一些关于管理 JSON 数据的问题。我有如下 JSON 格式:
{
"msg": "Success"
"data": [
{
"id": "1",
"notelp": "0000000000",
"user": "no1"
},
{
"id": "2",
"notelp": "1111111111",
"user": "no2"
},
],}
我想从变量“notelp”中获取值,我希望输出像这样 {"0000000000", "1111111111",} 如何获得它?
我以前试过这个,但还是不能得到我想要的,
if (response.statusCode == 200) {
final result = json.decode(response.body);
debugPrint('dataTelp: ${result['data']['notelp']}');
}
谢谢你们帮我解决这个问题并保持保存。
【问题讨论】:
-
您是否尝试将“notelp”添加到列表中?所以你会得到像 ["0000000000", "1111111111",] 这样的输出