[英]How to convert Future<List<Object>> to List<Object>?
i'm getting values from API and it's in a Future<List<Object>>
form how do i convert into List<Objects>
?我从 API 获取值,它是
Future<List<Object>>
形式我如何转换成List<Objects>
?
i already tried using Future Builder but it recursively return NoDataDialog Widget.我已经尝试过使用 Future Builder,但它递归地返回 NoDataDialog 小部件。
There are two ways to deal with async functions处理异步函数有两种方法
1st第一
_asyncFunction() async {
List list = await futureList;
}
2nd第二
_asyncFunction() {
Future.delayed(Duration(seconds: 10), () {
//this executes
}).then((_) {
//then this
});
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.