参数类型'List<dynamic>?'不能分配给参数类型"列表<dynamic>"。 使用列表时



这是我的代码:

future: getData(),
builder: (context, snapshot) {
if (snapshot.hasError) {
print(snapshot.error);
}
return snapshot.hasData
? new ItemList(
list: snapshot.data,
)
: new Center(
child: new CircularProgressIndicator(),
);
},
),

我得到错误的"list: snapshot.data,"错误是参数类型为List?'不能分配给参数类型'List'.">

请帮助我的代码,我使用的是最新版本的扑动。谢谢你 ...........

null安全有问题

list: snapshot.data!,

这将解决您的问题

相关内容

最新更新