mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-20 11:08:03 +08:00
opt: notify-debugger-on-exception (#1750)
This commit is contained in:
committed by
GitHub
parent
76c2de4394
commit
0f8166620e
@@ -4,11 +4,11 @@ import 'dart:io';
|
||||
import 'package:PiliPlus/utils/storage_pref.dart';
|
||||
import 'package:PiliPlus/utils/utils.dart';
|
||||
import 'package:auto_orientation/auto_orientation.dart';
|
||||
import 'package:flutter/foundation.dart' show kDebugMode;
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
bool _isDesktopFullScreen = false;
|
||||
|
||||
@pragma('vm:notify-debugger-on-exception')
|
||||
Future<void> enterDesktopFullscreen({bool inAppFullScreen = false}) async {
|
||||
if (!inAppFullScreen && !_isDesktopFullScreen) {
|
||||
_isDesktopFullScreen = true;
|
||||
@@ -16,12 +16,11 @@ Future<void> enterDesktopFullscreen({bool inAppFullScreen = false}) async {
|
||||
await const MethodChannel(
|
||||
'com.alexmercerind/media_kit_video',
|
||||
).invokeMethod('Utils.EnterNativeFullscreen');
|
||||
} catch (_) {
|
||||
if (kDebugMode) rethrow;
|
||||
}
|
||||
} catch (_) {}
|
||||
}
|
||||
}
|
||||
|
||||
@pragma('vm:notify-debugger-on-exception')
|
||||
Future<void> exitDesktopFullscreen() async {
|
||||
if (_isDesktopFullScreen) {
|
||||
_isDesktopFullScreen = false;
|
||||
@@ -29,19 +28,16 @@ Future<void> exitDesktopFullscreen() async {
|
||||
await const MethodChannel(
|
||||
'com.alexmercerind/media_kit_video',
|
||||
).invokeMethod('Utils.ExitNativeFullscreen');
|
||||
} catch (_) {
|
||||
if (kDebugMode) rethrow;
|
||||
}
|
||||
} catch (_) {}
|
||||
}
|
||||
}
|
||||
|
||||
//横屏
|
||||
@pragma('vm:notify-debugger-on-exception')
|
||||
Future<void> landscape() async {
|
||||
try {
|
||||
await AutoOrientation.landscapeAutoMode(forceSensor: true);
|
||||
} catch (_) {
|
||||
if (kDebugMode) rethrow;
|
||||
}
|
||||
} catch (_) {}
|
||||
}
|
||||
|
||||
//竖屏
|
||||
|
||||
Reference in New Issue
Block a user