From 01c55ccb9a03419400d34ec92e2e22369c5f9a96 Mon Sep 17 00:00:00 2001 From: orz12 Date: Fri, 22 Mar 2024 00:47:08 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=95=AA=E5=89=A7=E6=A8=AA=E5=B1=8F?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=94=99=E8=AF=AF=EF=BC=9B=E5=BE=AE=E8=B0=83?= =?UTF-8?q?=E6=A8=AA=E5=B1=8F=E5=B0=BA=E5=AF=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pages/video/detail/view.dart | 62 +++++++++++++++++--------------- 1 file changed, 33 insertions(+), 29 deletions(-) diff --git a/lib/pages/video/detail/view.dart b/lib/pages/video/detail/view.dart index 73bd108b..91f00e98 100644 --- a/lib/pages/video/detail/view.dart +++ b/lib/pages/video/detail/view.dart @@ -648,11 +648,11 @@ class _VideoDetailPageState extends State // 系数是以下三个方程(分别代表特定平板、折叠屏内屏、普通手机横屏尺寸)的近似解 // 820x+1180y+983.67z=450 // 1812x+2176y+1985.68z=680 - // 1080x+2340y+1589.72z=540 + // 1080x+2340y+1589.72z=560 final double videoheight = - sqrt(context.height * context.width) * 12.972 - - context.height * 7.928 - - context.width * 4.923; + sqrt(context.height * context.width) * 12.555 - + context.height * 7.690 - + context.width * 4.741; final double videowidth = videoheight * 16 / 9; return Row( children: [ @@ -809,25 +809,28 @@ class _VideoDetailPageState extends State ], ))), SizedBox( - width: isFullScreen.value == true - ? context.width - : videowidth, - height: isFullScreen.value == true - ? 0 - : context.height - - videoheight - - MediaQuery.of(context).padding.top - - MediaQuery.of(context).padding.bottom, - child: (videoDetailController.videoType == - SearchType.video) - ? const CustomScrollView( - slivers: [VideoIntroPanel()]) - : (videoDetailController.videoType == - SearchType.media_bangumi) - ? Obx(() => BangumiIntroPanel( - cid: videoDetailController.cid.value)) - : const SizedBox(), - ) + width: isFullScreen.value == true + ? context.width + : videowidth, + height: isFullScreen.value == true + ? 0 + : context.height - + videoheight - + MediaQuery.of(context).padding.top - + MediaQuery.of(context).padding.bottom, + child: CustomScrollView( + key: const PageStorageKey('简介'), + slivers: [ + if (videoDetailController.videoType == + SearchType.video) ...[ + const VideoIntroPanel(), + ] else if (videoDetailController.videoType == + SearchType.media_bangumi) ...[ + Obx(() => BangumiIntroPanel( + cid: videoDetailController.cid.value)), + ] + ], + )) ], ), SizedBox( @@ -843,11 +846,13 @@ class _VideoDetailPageState extends State child: TabBarView( controller: videoDetailController.tabCtr, children: [ - const CustomScrollView( - slivers: [ - RelatedVideoPanel(), - ], - ), + if (videoDetailController.videoType == + SearchType.video) + const CustomScrollView( + slivers: [ + RelatedVideoPanel(), + ], + ), Obx( () => VideoReplyPanel( bvid: videoDetailController.bvid, @@ -883,7 +888,6 @@ class _VideoDetailPageState extends State ), ); if (!horizontalScreen) { - Orientation orientation = MediaQuery.of(context).orientation; if (Platform.isAndroid) { return PiPSwitcher( childWhenDisabled: childWhenDisabled,