简体   繁体   English

Flutter:“pr.dismiss”无法在进程对话框中定义

[英]Flutter:“pr.dismiss” cannot defined in progress dialog

I run my application, but show this error.我运行我的应用程序,但显示此错误。 Before this i can run it.在此之前我可以运行它。 But now, It says "pr.dismiss is not defined in progress dialog."但现在,它说“pr.dismiss 未在进度对话框中定义”。 I have install package,and my code in flutter is not red colour but run it that got error in debug.我已经安装了 package,我在 flutter 中的代码不是红色,但运行它却在调试时出错。 So how i can solves this problem?那么我该如何解决这个问题呢?

I RUN THIS GOT PROBLEM我遇到了这个问题

as per your source code you use https://pub.dev/packages/progress_dialog package for display progress dialog.根据您的源代码,您使用https://pub.dev/packages/progress_dialog package 显示进度对话框。 so as per this package for dismiss dialog you need to use the below method.因此,根据此 package 的关闭对话框,您需要使用以下方法。

pr.hide().then((isHidden) {
  print(isHidden);
});

// or // 或者

await pr.hide();

So replace pr.dismiss() with the above method.所以用上面的方法替换 pr.dismiss() 。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM