@@ -26,6 +26,7 @@ class BeamPage extends Page {
2626 this .popToNamed,
2727 this .type = BeamPageType .material,
2828 this .routeBuilder,
29+ this .fullScreenDialog = false ,
2930 this .keepQueryOnPop = false ,
3031 }) : super (key: key, name: name);
3132
@@ -108,6 +109,11 @@ class BeamPage extends Page {
108109 final Route Function (RouteSettings settings, Widget child)?
109110 routeBuilder;
110111
112+ /// Whether to present current [BeamPage] as a fullscreen dialog
113+ ///
114+ /// On iOS, dialog transitions animate differently and are also not closeable with the back swipe gesture
115+ final bool fullScreenDialog;
116+
111117 /// When this [BeamPage] pops from [Navigator] stack, whether to keep the
112118 /// query parameters within current [BeamLocation] .
113119 ///
@@ -122,11 +128,13 @@ class BeamPage extends Page {
122128 switch (type) {
123129 case BeamPageType .cupertino:
124130 return CupertinoPageRoute (
131+ fullscreenDialog: fullScreenDialog,
125132 settings: this ,
126133 builder: (context) => child,
127134 );
128135 case BeamPageType .fadeTransition:
129136 return PageRouteBuilder (
137+ fullscreenDialog: fullScreenDialog,
130138 settings: this ,
131139 pageBuilder: (_, __, ___) => child,
132140 transitionsBuilder: (_, animation, __, child) => FadeTransition (
@@ -136,6 +144,7 @@ class BeamPage extends Page {
136144 );
137145 case BeamPageType .slideTransition:
138146 return PageRouteBuilder (
147+ fullscreenDialog: fullScreenDialog,
139148 settings: this ,
140149 pageBuilder: (_, __, ___) => child,
141150 transitionsBuilder: (_, animation, __, child) => SlideTransition (
@@ -147,6 +156,7 @@ class BeamPage extends Page {
147156 );
148157 case BeamPageType .scaleTransition:
149158 return PageRouteBuilder (
159+ fullscreenDialog: fullScreenDialog,
150160 settings: this ,
151161 pageBuilder: (_, __, ___) => child,
152162 transitionsBuilder: (_, animation, __, child) => ScaleTransition (
@@ -156,11 +166,13 @@ class BeamPage extends Page {
156166 );
157167 case BeamPageType .noTransition:
158168 return PageRouteBuilder (
169+ fullscreenDialog: fullScreenDialog,
159170 settings: this ,
160171 pageBuilder: (context, animation, secondaryAnimation) => child,
161172 );
162173 default :
163174 return MaterialPageRoute (
175+ fullscreenDialog: fullScreenDialog,
164176 settings: this ,
165177 builder: (context) => child,
166178 );
0 commit comments