Showing
1 changed file
with
21 additions
and
0 deletions
| @@ -161,6 +161,27 @@ class GetMaterialApp extends StatelessWidget { | @@ -161,6 +161,27 @@ class GetMaterialApp extends StatelessWidget { | ||
| 161 | final match = Get.routeTree.matchRoute(name); | 161 | final match = Get.routeTree.matchRoute(name); |
| 162 | Get.parameters = match?.parameters; | 162 | Get.parameters = match?.parameters; |
| 163 | 163 | ||
| 164 | + //Route can be nullable, just pass the initial route | ||
| 165 | + if (match?.route == null) { | ||
| 166 | + return [ | ||
| 167 | + GetPageRoute( | ||
| 168 | + page: unknownRoute.page, | ||
| 169 | + parameter: unknownRoute.parameter, | ||
| 170 | + settings: RouteSettings(name: name, arguments: null), | ||
| 171 | + curve: unknownRoute.curve, | ||
| 172 | + opaque: unknownRoute.opaque, | ||
| 173 | + customTransition: unknownRoute.customTransition, | ||
| 174 | + binding: unknownRoute.binding, | ||
| 175 | + bindings: unknownRoute.bindings, | ||
| 176 | + transitionDuration: (unknownRoute.transitionDuration ?? | ||
| 177 | + Get.defaultTransitionDuration), | ||
| 178 | + transition: unknownRoute.transition, | ||
| 179 | + popGesture: unknownRoute.popGesture, | ||
| 180 | + fullscreenDialog: unknownRoute.fullscreenDialog, | ||
| 181 | + ) | ||
| 182 | + ]; | ||
| 183 | + } | ||
| 184 | + | ||
| 164 | return [ | 185 | return [ |
| 165 | GetPageRoute( | 186 | GetPageRoute( |
| 166 | page: match.route.page, | 187 | page: match.route.page, |
-
Please register or login to post a comment