From 08566dc40e9c2c88b1b31846b1af1a742f0fc848 Mon Sep 17 00:00:00 2001 From: orz12 Date: Wed, 5 Jun 2024 16:13:37 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=A8=AA=E5=B1=8F=E5=85=A8=E5=B1=8F?= =?UTF-8?q?=E6=97=B6=E4=B9=9F=E6=98=BE=E7=A4=BA=E8=BF=94=E5=9B=9E=E4=B8=BB?= =?UTF-8?q?=E9=A1=B5=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../video/detail/widgets/header_control.dart | 61 ++++++++----------- 1 file changed, 27 insertions(+), 34 deletions(-) diff --git a/lib/pages/video/detail/widgets/header_control.dart b/lib/pages/video/detail/widgets/header_control.dart index 2f14564c5..0c9cd7eaa 100644 --- a/lib/pages/video/detail/widgets/header_control.dart +++ b/lib/pages/video/detail/widgets/header_control.dart @@ -1168,7 +1168,9 @@ class _HeaderControlState extends State { final _ = widget.controller!; // final bool isLandscape = // MediaQuery.of(context).orientation == Orientation.landscape; - + bool equivalentFullScreen = !isFullScreen && + !horizontalScreen && + MediaQuery.of(context).orientation == Orientation.landscape; return LayoutBuilder(builder: (context, boxConstraints) { return AppBar( backgroundColor: Colors.transparent, @@ -1203,12 +1205,29 @@ class _HeaderControlState extends State { } }, )), + if (!isFullScreen || + MediaQuery.of(context).orientation != Orientation.portrait) + SizedBox( + width: 42, + height: 34, + child: IconButton( + tooltip: '返回主页', + icon: const Icon( + FontAwesomeIcons.house, + size: 15, + color: Colors.white, + ), + onPressed: () async { + // 销毁播放器实例 + // await widget.controller!.dispose(type: 'all'); + if (mounted) { + Navigator.popUntil( + context, (Route route) => route.isFirst); + } + }, + )), if ((videoIntroController.videoDetail.value.title != null) && - (isFullScreen || - (!isFullScreen && - MediaQuery.of(context).orientation == - Orientation.landscape && - !horizontalScreen))) ...[ + (isFullScreen || equivalentFullScreen)) Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -1248,35 +1267,9 @@ class _HeaderControlState extends State { ) ], ), - ] else ...[ - SizedBox( - width: 42, - height: 34, - child: IconButton( - tooltip: '返回主页', - icon: const Icon( - FontAwesomeIcons.house, - size: 15, - color: Colors.white, - ), - onPressed: () async { - // 销毁播放器实例 - // await widget.controller!.dispose(type: 'all'); - if (mounted) { - Navigator.popUntil( - context, (Route route) => route.isFirst); - } - }, - )), - ], const Spacer(), - if ((isFullScreen && - MediaQuery.of(context).orientation == - Orientation.landscape) || - (!isFullScreen && - MediaQuery.of(context).orientation == - Orientation.landscape && - !horizontalScreen)) ...[ + if (MediaQuery.of(context).orientation == Orientation.landscape && + (isFullScreen || !horizontalScreen)) ...[ // const Spacer(), // show current datetime Obx(