Kaynağa Gözat

Hide: Go back after a fixed delay

Neeraj Gupta 2 yıl önce
ebeveyn
işleme
27328e3fc5
1 değiştirilmiş dosya ile 4 ekleme ve 1 silme
  1. 4 1
      lib/ui/viewer/file/fading_app_bar.dart

+ 4 - 1
lib/ui/viewer/file/fading_app_bar.dart

@@ -258,8 +258,11 @@ class FadingAppBarState extends State<FadingAppBar> {
     try {
       final hideResult =
           await CollectionsService.instance.hideFiles(context, [widget.file]);
+
       if (hideResult) {
-        // Navigator.of(context, rootNavigator: true).pop();
+        // delay to avoid black screen
+        await Future.delayed(const Duration(milliseconds: 300));
+        Navigator.of(context).pop();
       }
     } catch (e, s) {
       _logger.severe("failed to update file visibility", e, s);