目前,我正在更新基于以前版本开发的 Flutter 项目的代码库。一旦我们更新到最新版本的 Dart 和 Flutter,就会发生错误。
这里的代码与我们从FutureBuilder
.
body: new FutureBuilder<List>(
future: getData(),
builder: (context, snapshot) {
if (snapshot.hasError) print(snapshot.error);
return snapshot.hasData
? new ItemList(
list: snapshot.data, <--- error in here
)
: new Center(
child: new CircularProgressIndicator(),
);
},
),
颤振版本:2.2.2
飞镖版本:2.13.3
请帮我指出我应该为这个处理的部分。谢谢!