Browse Source

Make full screen compatible with nested navigators (#218)

Sat Mandir S. Khalsa 6 năm trước cách đây
mục cha
commit
0824f3bdd6
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      lib/src/chewie_player.dart

+ 2 - 2
lib/src/chewie_player.dart

@@ -62,7 +62,7 @@ class ChewieState extends State<Chewie> {
       _isFullScreen = true;
       await _pushFullScreenWidget(context);
     } else if (_isFullScreen) {
-      Navigator.of(context).pop();
+      Navigator.of(context, rootNavigator: true).pop();
       _isFullScreen = false;
     }
   }
@@ -139,7 +139,7 @@ class ChewieState extends State<Chewie> {
       Screen.keepOn(true);
     }
 
-    await Navigator.of(context).push(route);
+    await Navigator.of(context, rootNavigator: true).push(route);
     _isFullScreen = false;
     widget.controller.exitFullScreen();