From de6e402d9769679c253c2054c66efac809621469 Mon Sep 17 00:00:00 2001 From: HCha Date: Wed, 8 Apr 2026 20:40:26 +0800 Subject: [PATCH] fix return button not working (#1883) * fix: return button won't work #1 * feat: return horizontal | isPortrait * revert: e85ccc7 onPopInvokedWithResult isPortrait * revert: e85ccc7 * remove unused param --------- Co-authored-by: dom --- lib/pages/live_room/view.dart | 3 +-- lib/pages/video/view.dart | 1 - lib/pages/video/widgets/header_control.dart | 7 ++----- lib/plugin/pl_player/controller.dart | 6 ++---- 4 files changed, 5 insertions(+), 12 deletions(-) diff --git a/lib/pages/live_room/view.dart b/lib/pages/live_room/view.dart index dcb0588be..ff08d8178 100644 --- a/lib/pages/live_room/view.dart +++ b/lib/pages/live_room/view.dart @@ -346,8 +346,7 @@ class _LiveRoomPageState extends State } return popScope( canPop: !isFullScreen && !plPlayerController.isDesktopPip, - onPopInvokedWithResult: (didPop, result) => - plPlayerController.onPopInvokedWithResult(didPop, result, isPortrait), + onPopInvokedWithResult: plPlayerController.onPopInvokedWithResult, child: player, ); } diff --git a/lib/pages/video/view.dart b/lib/pages/video/view.dart index 6bb06c544..e5ebb38f0 100644 --- a/lib/pages/video/view.dart +++ b/lib/pages/video/view.dart @@ -2121,7 +2121,6 @@ class _VideoDetailPageVState extends State videoDetailController.plPlayerController.onPopInvokedWithResult( didPop, result, - isPortrait, ); } diff --git a/lib/pages/video/widgets/header_control.dart b/lib/pages/video/widgets/header_control.dart index af73cbf30..6a1424c19 100644 --- a/lib/pages/video/widgets/header_control.dart +++ b/lib/pages/video/widgets/header_control.dart @@ -1756,11 +1756,8 @@ class HeaderControlState extends State size: 15, color: Colors.white, ), - onPressed: () => plPlayerController.onPopInvokedWithResult( - false, - null, - videoDetailCtr.isPortrait, - ), + onPressed: () => + plPlayerController.onPopInvokedWithResult(false, null), ), ), if (!plPlayerController.isDesktopPip && diff --git a/lib/plugin/pl_player/controller.dart b/lib/plugin/pl_player/controller.dart index 93806bec6..26e5356f3 100644 --- a/lib/plugin/pl_player/controller.dart +++ b/lib/plugin/pl_player/controller.dart @@ -1746,7 +1746,7 @@ class PlPlayerController with BlockConfigMixin { }); } - void onPopInvokedWithResult(bool didPop, Object? result, bool isPortrait) { + void onPopInvokedWithResult(bool didPop, Object? result) { if (didPop) { if (Platform.isAndroid) { _disableAutoEnterPipIfNeeded(); @@ -1765,8 +1765,6 @@ class PlPlayerController with BlockConfigMixin { triggerFullScreen(status: false); return; } - if (!horizontalScreen && !isPortrait) { - Get.back(); - } + Get.back(); } }