diff --git a/lib/pages/video/detail/view.dart b/lib/pages/video/detail/view.dart index e285d8e2..c250778d 100644 --- a/lib/pages/video/detail/view.dart +++ b/lib/pages/video/detail/view.dart @@ -592,24 +592,24 @@ class _VideoDetailPageState extends State color: Theme.of(context).colorScheme.background, child: Column( children: [ - Opacity( - opacity: 0, - child: SizedBox( - width: context.width, - height: 0, - child: Obx( - () => TabBar( - controller: videoDetailController.tabCtr, - dividerColor: Colors.transparent, - indicatorColor: - Theme.of(context).colorScheme.background, - tabs: videoDetailController.tabs - .map((String name) => Tab(text: name)) - .toList(), - ), - ), - ), - ), + // Opacity( + // opacity: 0, + // child: SizedBox( + // width: context.width, + // height: 0, + // child: Obx( + // () => TabBar( + // controller: videoDetailController.tabCtr, + // dividerColor: Colors.transparent, + // indicatorColor: + // Theme.of(context).colorScheme.background, + // tabs: videoDetailController.tabs + // .map((String name) => Tab(text: name)) + // .toList(), + // ), + // ), + // ), + // ), Expanded( child: TabBarView( physics: const BouncingScrollPhysics(), @@ -848,6 +848,20 @@ class _VideoDetailPageState extends State final double videoWidth = videoHeight * 9 / 16; return Row( children: [ + Expanded( + child: CustomScrollView( + key: PageStorageKey('简介${videoDetailController.bvid}'), + slivers: [ + if (videoDetailController.videoType == SearchType.video) ...[ + VideoIntroPanel(heroTag: heroTag), + RelatedVideoPanel(heroTag: heroTag), + ] else if (videoDetailController.videoType == + SearchType.media_bangumi) ...[ + Obx(() => BangumiIntroPanel( + heroTag: heroTag, cid: videoDetailController.cid.value)), + ] + ], + )), SizedBox( height: videoHeight, width: isFullScreen.value == true ? context.width : videoWidth, @@ -897,32 +911,14 @@ class _VideoDetailPageState extends State ), ), Expanded( - child: Row(children: [ - Expanded( - child: CustomScrollView( - key: PageStorageKey('简介${videoDetailController.bvid}'), - slivers: [ - if (videoDetailController.videoType == SearchType.video) ...[ - VideoIntroPanel(heroTag: heroTag), - RelatedVideoPanel(heroTag: heroTag), - ] else if (videoDetailController.videoType == - SearchType.media_bangumi) ...[ - Obx(() => BangumiIntroPanel( - heroTag: heroTag, - cid: videoDetailController.cid.value)), - ] - ], - )), - Expanded( - child: Obx( - () => VideoReplyPanel( - bvid: videoDetailController.bvid, - oid: videoDetailController.oid.value, - heroTag: heroTag, - ), + child: Obx( + () => VideoReplyPanel( + bvid: videoDetailController.bvid, + oid: videoDetailController.oid.value, + heroTag: heroTag, ), - ) - ])) + ), + ), // Expanded( // child: TabBarView( // physics: const BouncingScrollPhysics(), @@ -1019,16 +1015,13 @@ class _VideoDetailPageState extends State ] ], ))), - SizedBox( - width: - isFullScreen.value == true ? context.width : videoWidth, - height: isFullScreen.value == true - ? 0 - : context.height - - videoHeight - - (removeSafeArea - ? 0 - : MediaQuery.of(context).padding.top), + Offstage( + offstage: isFullScreen.value == true, + child: SizedBox( + width: videoWidth, + height: context.height - + videoHeight - + (removeSafeArea ? 0 : MediaQuery.of(context).padding.top), child: CustomScrollView( key: PageStorageKey( '简介${videoDetailController.bvid}'), @@ -1036,7 +1029,7 @@ class _VideoDetailPageState extends State if (videoDetailController.videoType == SearchType.video) ...[ VideoIntroPanel(heroTag: heroTag), - RelatedVideoPanel(heroTag: heroTag), + // RelatedVideoPanel(heroTag: heroTag), ] else if (videoDetailController.videoType == SearchType.media_bangumi) ...[ Obx(() => BangumiIntroPanel( @@ -1044,41 +1037,43 @@ class _VideoDetailPageState extends State cid: videoDetailController.cid.value)), ] ], - )) + ), + ), + ), ], ), - SizedBox( - width: isFullScreen.value == true - ? 0 - : (context.width - - videoWidth - - (removeSafeArea - ? 0 - : (MediaQuery.of(context).padding.left + - MediaQuery.of(context).padding.right))), + Offstage( + offstage: isFullScreen.value == true, + child: SizedBox( + width: (context.width - + videoWidth - + (removeSafeArea + ? 0 + : (MediaQuery.of(context).padding.left + + MediaQuery.of(context).padding.right))), height: context.height - (removeSafeArea ? 0 : MediaQuery.of(context).padding.top), - child: - // TabBarView( - // physics: const BouncingScrollPhysics(), - // controller: videoDetailController.tabCtr, - // children: [ - // if (videoDetailController.videoType == SearchType.video) - // const CustomScrollView( - // slivers: [ - // RelatedVideoPanel(), - // ], - // ), + child: TabBarView( + physics: const BouncingScrollPhysics(), + controller: videoDetailController.tabCtr, + children: [ + if (videoDetailController.videoType == SearchType.video) + CustomScrollView( + slivers: [ + RelatedVideoPanel(heroTag: heroTag), + ], + ), Obx( - () => VideoReplyPanel( - bvid: videoDetailController.bvid, - oid: videoDetailController.oid.value, - heroTag: heroTag, - ), - ) - // ], - // ), - ) + () => VideoReplyPanel( + bvid: videoDetailController.bvid, + oid: videoDetailController.oid.value, + heroTag: heroTag, + ), + ) + ], + ), + ), + ) ], ); });