mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-07 21:48:14 -08:00
fix: System bars contiuously showing on Android video player (#568)
Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
parent
861d75b1e9
commit
b9c1e82b43
2 changed files with 17 additions and 10 deletions
|
|
@ -60,6 +60,7 @@ class _DesktopControlsState extends ConsumerState<DesktopControls> {
|
|||
final fadeDuration = const Duration(milliseconds: 350);
|
||||
bool showOverlay = true;
|
||||
bool wasPlaying = false;
|
||||
SystemUiMode? _currentSystemUiMode;
|
||||
|
||||
late final double topPadding = MediaQuery.of(context).viewPadding.top;
|
||||
late final double bottomPadding = MediaQuery.of(context).viewPadding.bottom;
|
||||
|
|
@ -625,7 +626,14 @@ class _DesktopControlsState extends ConsumerState<DesktopControls> {
|
|||
if (showOverlay == (value ?? !showOverlay)) return;
|
||||
setState(() => showOverlay = (value ?? !showOverlay));
|
||||
resetTimer();
|
||||
SystemChrome.setEnabledSystemUIMode(showOverlay ? SystemUiMode.edgeToEdge : SystemUiMode.leanBack, overlays: []);
|
||||
|
||||
final desiredMode = showOverlay ? SystemUiMode.edgeToEdge : SystemUiMode.immersiveSticky;
|
||||
|
||||
if (_currentSystemUiMode != desiredMode) {
|
||||
_currentSystemUiMode = desiredMode;
|
||||
SystemChrome.setEnabledSystemUIMode(desiredMode, overlays: []);
|
||||
}
|
||||
|
||||
SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle(
|
||||
statusBarColor: Colors.transparent,
|
||||
systemNavigationBarColor: Colors.transparent,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue