Joh*_*ans 5 flutter flutter-web
如果我这样做,例如:
FutureBuilder(
initialData: null,
future: compute(expensiveParsingOperation, data),
builder: (context, snapshot) {
if(!snapshot.hasData){
// This doesn't spin (frozen). The entire UI is janked until the expensive operation future completes.
CircularProgressIndicator();
}else {
Container();
}
});
Run Code Online (Sandbox Code Playgroud)
我希望上述内容将expensiveParsingOperation函数发送给网络工作者或其他东西,而不是卡住主线程,但这不是我观察中发生的情况。
| 归档时间: |
|
| 查看次数: |
766 次 |
| 最近记录: |