From 8f9743166597c0eb01371196bfa99aadbb3c61cc Mon Sep 17 00:00:00 2001 From: guozhigq Date: Mon, 18 Sep 2023 07:39:56 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=86=E9=A2=91=E5=85=A8=E5=B1=8F?= =?UTF-8?q?=E6=97=B6=E7=9A=84=E5=AE=89=E5=85=A8=E5=8C=BA=E5=9F=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/plugin/pl_player/controller.dart | 10 +++--- lib/plugin/pl_player/view.dart | 46 +++++++++++++++------------- 2 files changed, 31 insertions(+), 25 deletions(-) diff --git a/lib/plugin/pl_player/controller.dart b/lib/plugin/pl_player/controller.dart index 9121c963..01476ade 100644 --- a/lib/plugin/pl_player/controller.dart +++ b/lib/plugin/pl_player/controller.dart @@ -817,6 +817,10 @@ class PlPlayerController { } toggleFullScreen(true); + bool isValid = + direction.value == 'vertical' || mode == FullScreenMode.vertical + ? true + : false; var result = await showDialog( context: Get.context!, useSafeArea: false, @@ -824,12 +828,10 @@ class PlPlayerController { backgroundColor: Colors.black, child: SafeArea( // 忽略手机安全区域 + top: isValid, left: false, right: false, - bottom: - direction.value == 'vertical' || mode == FullScreenMode.vertical - ? true - : false, + bottom: isValid, child: PLVideoPlayer( controller: this, headerControl: headerControl, diff --git a/lib/plugin/pl_player/view.dart b/lib/plugin/pl_player/view.dart index b3905b24..2a8311a5 100644 --- a/lib/plugin/pl_player/view.dart +++ b/lib/plugin/pl_player/view.dart @@ -547,34 +547,38 @@ class _PLVideoPlayerState extends State ), // 头部、底部控制条 - Obx( - () => Column( - children: [ - if (widget.headerControl != null || _.headerControl != null) + SafeArea( + top: false, + bottom: false, + child: Obx( + () => Column( + children: [ + if (widget.headerControl != null || _.headerControl != null) + ClipRect( + clipBehavior: Clip.hardEdge, + child: AppBarAni( + controller: animationController, + visible: !_.controlsLock.value && _.showControls.value, + position: 'top', + child: widget.headerControl ?? _.headerControl!, + ), + ), + const Spacer(), ClipRect( clipBehavior: Clip.hardEdge, child: AppBarAni( controller: animationController, visible: !_.controlsLock.value && _.showControls.value, - position: 'top', - child: widget.headerControl ?? _.headerControl!, + position: 'bottom', + child: widget.bottomControl ?? + BottomControl( + controller: widget.controller, + triggerFullScreen: + widget.controller.triggerFullScreen), ), ), - const Spacer(), - ClipRect( - clipBehavior: Clip.hardEdge, - child: AppBarAni( - controller: animationController, - visible: !_.controlsLock.value && _.showControls.value, - position: 'bottom', - child: widget.bottomControl ?? - BottomControl( - controller: widget.controller, - triggerFullScreen: - widget.controller.triggerFullScreen), - ), - ), - ], + ], + ), ), ),