fix rotation and status bar

This commit is contained in:
nyne
2024-10-30 09:39:56 +08:00
parent 0db633a9d9
commit cc29ff0c33
2 changed files with 5 additions and 0 deletions

View File

@@ -105,6 +105,7 @@ class _ReaderState extends State<Reader> with _ReaderLocation, _ReaderWindow {
Future.microtask(() { Future.microtask(() {
updateHistory(); updateHistory();
}); });
SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersive);
super.initState(); super.initState();
} }
@@ -112,6 +113,7 @@ class _ReaderState extends State<Reader> with _ReaderLocation, _ReaderWindow {
void dispose() { void dispose() {
autoPageTurningTimer?.cancel(); autoPageTurningTimer?.cancel();
focusNode.dispose(); focusNode.dispose();
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
super.dispose(); super.dispose();
} }

View File

@@ -47,6 +47,9 @@ class _ReaderScaffoldState extends State<_ReaderScaffold> {
sliderFocus.nextFocus(); sliderFocus.nextFocus();
} }
}); });
if(rotation != null) {
SystemChrome.setPreferredOrientations(DeviceOrientation.values);
}
super.initState(); super.initState();
} }