如何防止扑动对话框和ShowModalBottomSheet在导航后弹出
在我的Flutter Project中,我使用了警报对话框和ShowModalBottomsheet,并摇摆不定以防止这些小部件在导航到另一个屏幕后显示。
我使用if(已安装)
,但它不起作用 有什么建议可以解决这个问题吗?
In my flutter project, I used alert dialog and showModalBottomSheet and I wand to prevent these widgets from displaying after navigating to another screen.
I used if(mounted)
but it is not working
any advice to solve this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要在导航另一个屏幕之前使用
navigator.pop(context);
。例如
You need to use
Navigator.pop(context);
before navigate another screen.For example