From f8525db84e0fdb268acc0ccee3373fdd9aa678e1 Mon Sep 17 00:00:00 2001 From: Thibault Deckers Date: Mon, 1 Jul 2024 23:40:30 +0200 Subject: [PATCH] minor fix --- lib/widgets/viewer/entry_viewer_stack.dart | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/widgets/viewer/entry_viewer_stack.dart b/lib/widgets/viewer/entry_viewer_stack.dart index 7116ac759..5eb4dfbe0 100644 --- a/lib/widgets/viewer/entry_viewer_stack.dart +++ b/lib/widgets/viewer/entry_viewer_stack.dart @@ -683,7 +683,7 @@ class _EntryViewerStackState extends State with EntryViewContr final baseCollection = collection; if (baseCollection == null) return; - unawaited(_onLeave()); + await _onLeave(); final uri = entryNotifier.value?.uri; unawaited(Navigator.maybeOf(context)?.pushAndRemoveUntil( MaterialPageRoute( @@ -852,7 +852,7 @@ class _EntryViewerStackState extends State with EntryViewContr void _popVisual() { if (Navigator.canPop(context)) { Future pop() async { - unawaited(_onLeave()); + await _onLeave(); Navigator.maybeOf(context)?.pop(); } @@ -916,6 +916,10 @@ class _EntryViewerStackState extends State with EntryViewContr if (!settings.useTvLayout) { await windowService.requestOrientation(); } + // delay to prevent white/black flash on page transition + // from a viewer with a transparent background and no system UI + // to a regular page with system UI + await Future.delayed(const Duration(milliseconds: 50)); } Future _enablePictureInPicture(AvesVideoController? playingController) async {