【发布时间】:2020-11-18 05:20:14
【问题描述】:
我使用 API 作为返回 JSON 文件的支持。我需要使用这个 JSON 数据作为下拉按钮,以抖动我收到的 JSON 数据。
[
{
"store": "AMAZON"
},
{
"store": "FLIPKART"
},
{
"store": "WALMART"
},
{
"store": "ALIBABA"
},
]
JSON 的长度可能会不时变化。
在 Flutter 中,我使用这一行解码这个 JSON。
stores = json.decode(response.body);
print(stores[0]['store']);
我需要知道 json 的长度才能在下拉按钮中使用这些数据。如果有其他方法可以直接使用 json 来下拉也建议我。
【问题讨论】:
-
@GokulaKrishnan 抱歉,我已经搜索过了,但没有提供结果
标签: json flutter dart dropdown