[英]Flutter Launcher: Go back to the HomeScreen when Home Button is pressed
I am trying to make a launcher using flutter.我正在尝试使用 flutter 制作启动器。 I have made multiple screens for doing specific tasks like HomeScreen.我制作了多个屏幕来执行特定任务,例如 HomeScreen。 AppDrawerScreen and so on. AppDrawerScreen 等等。 The problem I am facing is whenever I go to say AppDrawerScreen and press on the Home Button, I am not redirected to the HomeScreen.我面临的问题是每当我 go 说 AppDrawerScreen 并按下 Home 按钮时,我都不会重定向到 HomeScreen。 How can I handle this scenario?我该如何处理这种情况?
I've had the same problem.我有同样的问题。 I guess the only solution is to listen to the Home button, and there go to the first screen.我想唯一的解决办法是听 Home 键,然后 go 到第一个屏幕。 there is a plugin called hardware_buttons , and about the Back button you can use the WillPopScope() widget.有一个名为hardware_buttons的插件,关于后退按钮,您可以使用 WillPopScope() 小部件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.