opt in-app fullscreen

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-09-26 10:26:27 +08:00
parent d961b6d7a9
commit 86a79a9733
10 changed files with 25 additions and 31 deletions

View File

@@ -8,14 +8,14 @@ import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';
//横屏
Future<void> landScape() async {
Future<void> landscape({bool inAppFullScreen = false}) async {
dynamic document;
try {
if (kIsWeb) {
await document.documentElement?.requestFullscreen();
} else if (Utils.isMobile) {
await AutoOrientation.landscapeAutoMode(forceSensor: true);
} else if (Utils.isDesktop && Pref.nativeFullscreen) {
} else if (Utils.isDesktop && !inAppFullScreen) {
await const MethodChannel(
'com.alexmercerind/media_kit_video',
).invokeMethod(
@@ -76,7 +76,7 @@ Future<void> hideStatusBar() async {
bool _showStatusBar = true;
//退出全屏显示
Future<void> showStatusBar() async {
Future<void> showStatusBar({bool inAppFullScreen = false}) async {
if (_showStatusBar) {
return;
}
@@ -94,7 +94,7 @@ Future<void> showStatusBar() async {
mode,
overlays: SystemUiOverlay.values,
);
} else if (Utils.isDesktop && Pref.nativeFullscreen) {
} else if (Utils.isDesktop && !inAppFullScreen) {
await const MethodChannel(
'com.alexmercerind/media_kit_video',
).invokeMethod(