Looking up a deactivated widget's ancestor is unsafe. flutter
高端VPN,微科 VPN 专线VPN,独立IP TikTok梯子,独享60元/月包年高速直连, 流畅播放Youtube 8K 视频不满意随时退款, QQ 2553878266
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();
});
});
评论