简体   繁体   English

Flutter 启动器:Go 按下主页按钮时返回主页屏幕

[英]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.

相关问题 当按下返回按钮到 go 到 HomeScreen 时如何处理 flutter 底部导航栏 - How to handle flutter bottom navigation bar when back button is pressed to go to the HomeScreen 获取后退按钮转到启动器 - Getting the back button to go to the Launcher 按下后退按钮后,按原样恢复原始活动(如主页按钮) - Restoring original activity as it is (like home button) when back button pressed 按下“主页”按钮并按下图标(在启动器上)后,应用程序重新启动 - After Home button pressed and pressed icon (on launcher) app restart 当按下 HOME 按钮时,防止 android 活动到 go 暂停 state - Prevent an android activity to go pause state when HOME button is pressed 按下“后退”按钮时如何返回上一个活动? - How to go back to Previous Activity when Back button is pressed? 按下硬件后退按钮时如何返回上一个片段 - how to go back to previous fragment when hardware back button is pressed 按下主页按钮时如何清除后堆栈 - How to clear back stack when Home button is pressed 按下主页或后退按钮时如何暂停/停止音乐? - How to pause/stop music when home or back button is pressed? 当按下Actionbar后退/主页按钮时调用什么方法? - what method is called when Actionbar back/home button is pressed?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM