|
|
|
@ -45,7 +45,7 @@ class _MainPageState extends State<MainPage> { |
|
|
|
homePage = HomePage(); |
|
|
|
discoverPage = DiscoverPage(); |
|
|
|
messagePage = MessagePage(); |
|
|
|
minePage = MinePage(); |
|
|
|
minePage = MinePage(key: pageBKey,); |
|
|
|
|
|
|
|
// 初始化UserController并调用获取环信用户token的方法 |
|
|
|
final userController = Get.put(UserController()); |
|
|
|
@ -71,6 +71,8 @@ class _MainPageState extends State<MainPage> { |
|
|
|
await RTMManager.instance.initialize(appId: '4c2ea9dcb4c5440593a418df0fdd512d', userId: userId ?? ''); |
|
|
|
} |
|
|
|
|
|
|
|
final pageBKey = GlobalKey<MinePageState>(); |
|
|
|
|
|
|
|
@override |
|
|
|
Widget build(BuildContext context) { |
|
|
|
return DoubleTapToExitWidget( |
|
|
|
@ -137,6 +139,9 @@ class _MainPageState extends State<MainPage> { |
|
|
|
onTap: () { |
|
|
|
currentIndex = index; |
|
|
|
pageController.jumpToPage(index); |
|
|
|
if(index == 3){ |
|
|
|
pageBKey.currentState?.getUserCount(); |
|
|
|
} |
|
|
|
}, |
|
|
|
); |
|
|
|
} |
|
|
|
|