From 74f7c5d0ea51d56e51acead709d3b55479ff64c6 Mon Sep 17 00:00:00 2001 From: bggRGjQaUbCoE Date: Mon, 7 Jul 2025 11:57:32 +0800 Subject: [PATCH] fix video tab Signed-off-by: bggRGjQaUbCoE --- lib/pages/video/view.dart | 47 +++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/lib/pages/video/view.dart b/lib/pages/video/view.dart index e5986606..a4c58fb3 100644 --- a/lib/pages/video/view.dart +++ b/lib/pages/video/view.dart @@ -1009,29 +1009,27 @@ class _VideoDetailPageVState extends State child: videoPlayer(videoWidth, videoHeight), ), Expanded( - child: Expanded( - child: Scaffold( - key: videoDetailController.childKey, - resizeToAvoidBottomInset: false, - backgroundColor: Colors.transparent, - body: Column( - children: [ - buildTabbar( - showIntro: false, - showReply: videoDetailController.showReply, + child: Scaffold( + key: videoDetailController.childKey, + resizeToAvoidBottomInset: false, + backgroundColor: Colors.transparent, + body: Column( + children: [ + buildTabbar( + showIntro: false, + showReply: videoDetailController.showReply, + ), + Expanded( + child: videoTabBarView( + controller: videoDetailController.tabCtr, + children: [ + if (videoDetailController.showReply) + videoReplyPanel(), + if (_shouldShowSeasonPanel) seasonPanel, + ], ), - Expanded( - child: videoTabBarView( - controller: videoDetailController.tabCtr, - children: [ - if (videoDetailController.showReply) - videoReplyPanel(), - if (_shouldShowSeasonPanel) seasonPanel, - ], - ), - ), - ], - ), + ), + ], ), ), ), @@ -1428,8 +1426,9 @@ class _VideoDetailPageVState extends State videoDetailController.tabCtr = TabController( vsync: this, length: tabs.length, - initialIndex: - videoDetailController.tabCtr.index.clamp(0, tabs.length - 1), + initialIndex: tabs.isEmpty + ? 0 + : videoDetailController.tabCtr.index.clamp(0, tabs.length - 1), ); }