mod: 修改全屏方式 issues #59
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:device_info_plus/device_info_plus.dart';
|
||||
import 'package:auto_orientation/auto_orientation.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
@ -11,16 +12,17 @@ Future<void> landScape() async {
|
||||
if (kIsWeb) {
|
||||
await document.documentElement?.requestFullscreen();
|
||||
} else if (Platform.isAndroid || Platform.isIOS) {
|
||||
await SystemChrome.setEnabledSystemUIMode(
|
||||
SystemUiMode.immersiveSticky,
|
||||
overlays: [],
|
||||
);
|
||||
await SystemChrome.setPreferredOrientations(
|
||||
[
|
||||
DeviceOrientation.landscapeLeft,
|
||||
DeviceOrientation.landscapeRight,
|
||||
],
|
||||
);
|
||||
// await SystemChrome.setEnabledSystemUIMode(
|
||||
// SystemUiMode.immersiveSticky,
|
||||
// overlays: [],
|
||||
// );
|
||||
// await SystemChrome.setPreferredOrientations(
|
||||
// [
|
||||
// DeviceOrientation.landscapeLeft,
|
||||
// DeviceOrientation.landscapeRight,
|
||||
// ],
|
||||
// );
|
||||
await AutoOrientation.landscapeAutoMode(forceSensor: true);
|
||||
} else if (Platform.isMacOS || Platform.isWindows || Platform.isLinux) {
|
||||
await const MethodChannel('com.alexmercerind/media_kit_video')
|
||||
.invokeMethod(
|
||||
|
Reference in New Issue
Block a user