【发布时间】:2020-02-22 13:47:21
【问题描述】:
您好,我正在尝试将数据从 JSON 列出到 Listview Builder 。但是 Flutter 给了我这个错误:Column's children must not contain any null values, but a null value was found at index 0
我试图在列表视图中像这样映射每一个
alo[Index]['rewards'].forEach((k, v) {
Text(v['name']);
}),
这是我的完整代码:
shrinkWrap: true,
itemCount: alo.length,
itemBuilder: (BuildContext ctxt, int Index) {
return Card(
child: Padding(
padding: const EdgeInsets.all(15.0),
child: Column(
children: <Widget>[
alo[Index]['rewards'].forEach((k, v) {
Text(v['name']);
}),
],
),
));
});
有什么解决办法吗?谢谢!
【问题讨论】: