From 0cac46ee26f4cdb229fcb305d1bd5a094f601b6f Mon Sep 17 00:00:00 2001 From: dom Date: Tue, 19 May 2026 14:38:08 +0800 Subject: [PATCH] fix setEnabledSystemUIMode Signed-off-by: dom --- lib/plugin/pl_player/utils/fullscreen.dart | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/plugin/pl_player/utils/fullscreen.dart b/lib/plugin/pl_player/utils/fullscreen.dart index ef490e712..7350b5ebf 100644 --- a/lib/plugin/pl_player/utils/fullscreen.dart +++ b/lib/plugin/pl_player/utils/fullscreen.dart @@ -94,15 +94,18 @@ Future? showSystemBar() { Future setEnabledSystemUIMode( SystemUiMode mode, { List? overlays, -}) async { +}) { + if (!Platform.isAndroid) { + return SystemChrome.setEnabledSystemUIMode(mode, overlays: overlays); + } if (mode != SystemUiMode.manual) { - await const MethodChannel('PiliPlus').invokeMethod( + return const MethodChannel('PiliPlus').invokeMethod( 'SystemChrome.setEnabledSystemUIMode', {'arguments': mode.toString()}, ); } else { assert(mode == SystemUiMode.manual && overlays != null); - await const MethodChannel('PiliPlus').invokeMethod( + return const MethodChannel('PiliPlus').invokeMethod( 'SystemChrome.setEnabledSystemUIOverlays', {'arguments': _stringify(overlays!)}, );