作者:赵顺帆_705 | 来源:互联网 | 2023-01-04 21:29
1> Hemanth Raj..:
您可以使用它setState
来重建UI.
例:
class TestList extends StatefulWidget {
final Future quiz;
TestList({this.quiz});
@override
_TestListState createState() => new _TestListState();
}
class _TestListState extends State {
bool loading = true;
_TestListState(){
widget.quiz.then((List value) {
// loop through the json object
for (var i = 0; i listArray = [];
return new Container(
child: new ListView(
children: loading?[]:listArray // when the state of loading changes from true to false, it'll force this widget to reload
));
}
}