Looking up a deactivated widget's ancestor is unsafe. flutter
Irder外贸平台,个人免费入驻 https://www.irder.com
Looking up a deactivated widget's ancestor is unsafe.
_model.saveMerchantProfile(_formData).then((_) {
Navigator.of(context).pop();
if (_model.errorMsg != null) {
showClzDialog(
context, _model.errorMsg!,
onPressFuction: () {
Navigator.of(context).pop();
});
}
});
究其原因,大概是Navigator.of(context).pop();把这个页面的context给销毁了,下面的dialog就找不到context了,改成下面的情况就好了
model.saveMerchantProfile(_formData).then((_) { showClzDialog(context, _model.errorMsg ?? '保存成功', onPressFuction: () { Navigator.of(context).pop(); }); });
评论
登陆评论
没有评论