Modified the routes function in App.dart to make the initial loading screen a default
This commit is contained in:
parent
f38146507e
commit
4300934e69
1 changed files with 7 additions and 7 deletions
|
|
@ -25,13 +25,7 @@ class App extends StatelessWidget {
|
||||||
Route routes(RouteSettings settings) {
|
Route routes(RouteSettings settings) {
|
||||||
final List<String> routeTokens = settings.name.split('/');
|
final List<String> routeTokens = settings.name.split('/');
|
||||||
print(routeTokens);
|
print(routeTokens);
|
||||||
if (settings.name == '/') {
|
if (routeTokens.first == 'login') {
|
||||||
return MaterialPageRoute(
|
|
||||||
builder: (BuildContext context) {
|
|
||||||
return InitialLoadingScreen();
|
|
||||||
},
|
|
||||||
);
|
|
||||||
} else if (routeTokens.first == 'login') {
|
|
||||||
return MaterialPageRoute(
|
return MaterialPageRoute(
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
return LoginScreen();
|
return LoginScreen();
|
||||||
|
|
@ -50,5 +44,11 @@ class App extends StatelessWidget {
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
// Default route.
|
||||||
|
return MaterialPageRoute(
|
||||||
|
builder: (BuildContext context) {
|
||||||
|
return InitialLoadingScreen();
|
||||||
|
},
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue