diff --git a/lib/pages/home_page/home_page.dart b/lib/pages/home_page/home_page.dart index 227d074..4bd36ad 100644 --- a/lib/pages/home_page/home_page.dart +++ b/lib/pages/home_page/home_page.dart @@ -164,6 +164,7 @@ class _HomePageState extends State @override void dispose() { + print(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>Homepagedispose>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"); WidgetsBinding.instance.removeObserver(this); streamSubscription.cancel(); reloadSubscription?.cancel(); @@ -207,13 +208,23 @@ class _HomePageState extends State _currentIndex = 0; } - return Scaffold( - body: IndexedStack( - index: _currentIndex, - children: contentWidgets, + return WillPopScope( + onWillPop: () async{ + print(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>HomepageBack>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"); + EventUtil.instance.fire("HomepageSignOut"); + // 退出app + // await SystemChannels.platform.invokeMethod('SystemNavigator.pop'); + return true; + + }, + child: Scaffold( + body: IndexedStack( + index: _currentIndex, + children: contentWidgets, + ), + //底部导航栏 + bottomNavigationBar: createBottomNavigationBar(tabs), ), - //底部导航栏 - bottomNavigationBar: createBottomNavigationBar(tabs), ); }