pikapika/lib/basic/config/AutoFullScreen.dart

27 lines
627 B
Dart
Raw Normal View History

2021-09-29 23:57:09 +00:00
/// 自动全屏
import 'package:flutter/material.dart';
import '../Common.dart';
import '../Method.dart';
late bool gAutoFullScreen;
Future<void> initAutoFullScreen() async {
gAutoFullScreen = await method.getAutoFullScreen();
}
String autoFullScreenName() {
return gAutoFullScreen ? "" : "";
}
Future<void> chooseAutoFullScreen(BuildContext context) async {
String? result =
await chooseListDialog<String>(context, "进入阅读器自动全屏", ["", ""]);
if (result != null) {
var target = result == "";
await method.setAutoFullScreen(target);
gAutoFullScreen = target;
}
}