颤振安全使用notifyListeners

时间:2021-06-07 10:38:19

标签: flutter flutter-change-notifier

A Model was used after being disposed.

比如:

Model(){
fetchData();
}
void fetchData() async{
 final r = await requset();
//...do something
notifyListeners();
}

当我使用notifyListeners()时,但模型已经处理掉了。如何安全使用notifyListeners()?

0 个答案:

没有答案