From 4300934e6904620caa0a2d723785bc1a2fe0de70 Mon Sep 17 00:00:00 2001 From: AYM1607 Date: Sun, 31 Mar 2019 19:05:57 -0600 Subject: [PATCH] Modified the routes function in App.dart to make the initial loading screen a default --- lib/src/App.dart | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/src/App.dart b/lib/src/App.dart index 10442ad..e8c7108 100644 --- a/lib/src/App.dart +++ b/lib/src/App.dart @@ -25,13 +25,7 @@ class App extends StatelessWidget { Route routes(RouteSettings settings) { final List routeTokens = settings.name.split('/'); print(routeTokens); - if (settings.name == '/') { - return MaterialPageRoute( - builder: (BuildContext context) { - return InitialLoadingScreen(); - }, - ); - } else if (routeTokens.first == 'login') { + if (routeTokens.first == 'login') { return MaterialPageRoute( builder: (BuildContext context) { return LoginScreen(); @@ -50,5 +44,11 @@ class App extends StatelessWidget { }, ); } + // Default route. + return MaterialPageRoute( + builder: (BuildContext context) { + return InitialLoadingScreen(); + }, + ); } }