mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
feat: 新增播放页重力感应屏蔽设置
This commit is contained in:
@@ -131,6 +131,12 @@ class _PlaySettingState extends State<PlaySetting> {
|
||||
setKey: SettingBoxKey.enableAutoExit,
|
||||
defaultVal: true,
|
||||
),
|
||||
const SetSwitchItem(
|
||||
title: '全向旋转',
|
||||
subTitle: '非全屏时可受重力转为临时全屏,若系统锁定旋转仍异常触发请关闭,无异常可保持开启',
|
||||
setKey: SettingBoxKey.allowRotateScreen,
|
||||
defaultVal: true,
|
||||
),
|
||||
const SetSwitchItem(
|
||||
title: '后台播放',
|
||||
subTitle: '进入后台时继续播放',
|
||||
|
||||
@@ -5,6 +5,8 @@ import 'package:auto_orientation/auto_orientation.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
import '../../../utils/storage.dart';
|
||||
|
||||
//横屏
|
||||
Future<void> landScape() async {
|
||||
dynamic document;
|
||||
@@ -44,6 +46,10 @@ Future<void> verticalScreen() async {
|
||||
|
||||
//全向
|
||||
Future<void> autoScreen() async {
|
||||
if (!GStrorage.setting
|
||||
.get(SettingBoxKey.allowRotateScreen, defaultValue: true)) {
|
||||
return;
|
||||
}
|
||||
await SystemChrome.setPreferredOrientations([
|
||||
DeviceOrientation.portraitUp,
|
||||
DeviceOrientation.portraitDown,
|
||||
|
||||
@@ -94,6 +94,7 @@ class SettingBoxKey {
|
||||
enableAutoBrightness = 'enableAutoBrightness',
|
||||
enableAutoEnter = 'enableAutoEnter',
|
||||
enableAutoExit = 'enableAutoExit',
|
||||
allowRotateScreen = 'allowRotateScreen',
|
||||
horizontalScreen = 'horizontalScreen',
|
||||
p1080 = 'p1080',
|
||||
enableCDN = 'enableCDN',
|
||||
|
||||
Reference in New Issue
Block a user