From 3dcbc7e0b9990f5d7c49d06a095923fc76f77fb9 Mon Sep 17 00:00:00 2001 From: "23028876916@qq.com" Date: Fri, 7 May 2021 11:10:12 +0800 Subject: [PATCH] =?UTF-8?q?0507=20=E4=BF=AE=E5=A4=8D=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E4=B8=8D=E5=85=B3=E9=97=AD=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E7=9A=84=E6=8A=96=E5=88=B8=E6=92=AD=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pages/home_page/home_page.dart | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/lib/pages/home_page/home_page.dart b/lib/pages/home_page/home_page.dart index 07e5156..7146d0a 100644 --- a/lib/pages/home_page/home_page.dart +++ b/lib/pages/home_page/home_page.dart @@ -159,6 +159,7 @@ class _HomePageState extends State @override void dispose() { + print(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>Homepagedispose>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"); WidgetsBinding.instance.removeObserver(this); streamSubscription.cancel(); reloadSubscription?.cancel(); @@ -202,13 +203,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), ); }