diff --git a/lib/pages/main/main_page.dart b/lib/pages/main/main_page.dart index 6ffdd24..f088cc2 100644 --- a/lib/pages/main/main_page.dart +++ b/lib/pages/main/main_page.dart @@ -45,7 +45,7 @@ class _MainPageState extends State { 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 { await RTMManager.instance.initialize(appId: '4c2ea9dcb4c5440593a418df0fdd512d', userId: userId ?? ''); } + final pageBKey = GlobalKey(); + @override Widget build(BuildContext context) { return DoubleTapToExitWidget( @@ -137,6 +139,9 @@ class _MainPageState extends State { onTap: () { currentIndex = index; pageController.jumpToPage(index); + if(index == 3){ + pageBKey.currentState?.getUserCount(); + } }, ); } diff --git a/lib/pages/mine/mine_page.dart b/lib/pages/mine/mine_page.dart index 971b3b2..cd35342 100644 --- a/lib/pages/mine/mine_page.dart +++ b/lib/pages/mine/mine_page.dart @@ -25,10 +25,10 @@ class MinePage extends StatefulWidget { const MinePage({super.key}); @override - State createState() => _MinePageState(); + State createState() => MinePageState(); } -class _MinePageState extends State with AutomaticKeepAliveClientMixin{ +class MinePageState extends State with AutomaticKeepAliveClientMixin{ late MineController controller; @@ -43,6 +43,7 @@ class _MinePageState extends State with AutomaticKeepAliveClientMixin{ ].obs; + @override void initState() { super.initState(); diff --git a/lib/widget/live/live_room_user_profile_dialog.dart b/lib/widget/live/live_room_user_profile_dialog.dart index 290e5e9..bb11bc7 100644 --- a/lib/widget/live/live_room_user_profile_dialog.dart +++ b/lib/widget/live/live_room_user_profile_dialog.dart @@ -45,7 +45,7 @@ void showUserProfileDialog( children: [ SizedBox(width: 110.w,), if(isHost) Container( - width: 111.w, + width: 100.w, height: 30.w, margin: EdgeInsets.only(right: 10.w), decoration: BoxDecoration(