Flutter 从Internet获取嵌套数据
如何获取嵌套json响应?我可以获取直接值,但无法获取嵌套值Flutter 从Internet获取嵌套数据,flutter,Flutter,如何获取嵌套json响应?我可以获取直接值,但无法获取嵌套值 { "username":"aa", "data":{ "key":"value", "anotherKey":"anotherValue" } } 您必须首先像这样解码json- var respBody = jsonDecode(response.body); 然后您可以使用respBody[“数据”][“键”]
{
"username":"aa",
"data":{
"key":"value",
"anotherKey":"anotherValue"
}
}
您必须首先像这样解码json-
var respBody = jsonDecode(response.body);
然后您可以使用respBody[“数据”][“键”]