Kaynağa Gözat

0507 修复返回按钮不关闭首页的抖券播放

tags/0.0.16+2
23028876916@qq.com 3 yıl önce
ebeveyn
işleme
3dcbc7e0b9
1 değiştirilmiş dosya ile 17 ekleme ve 6 silme
  1. +17
    -6
      lib/pages/home_page/home_page.dart

+ 17
- 6
lib/pages/home_page/home_page.dart Dosyayı Görüntüle

@@ -159,6 +159,7 @@ class _HomePageState extends State<HomePage>

@override
void dispose() {
print(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>Homepagedispose>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
WidgetsBinding.instance.removeObserver(this);
streamSubscription.cancel();
reloadSubscription?.cancel();
@@ -202,13 +203,23 @@ class _HomePageState extends State<HomePage>
_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),
);
}



Yükleniyor…
İptal
Kaydet