Fix missing redirect
This commit is contained in:
parent
3080f8d867
commit
110766d516
@ -31,6 +31,7 @@ class ScreenPaths {
|
|||||||
|
|
||||||
/// Routing table, matches string paths to UI Screens, optionally parses params from the paths
|
/// Routing table, matches string paths to UI Screens, optionally parses params from the paths
|
||||||
final appRouter = GoRouter(
|
final appRouter = GoRouter(
|
||||||
|
redirect: _handleRedirect,
|
||||||
routes: [
|
routes: [
|
||||||
ShellRoute(
|
ShellRoute(
|
||||||
builder: (context, router, navigator) {
|
builder: (context, router, navigator) {
|
||||||
@ -102,7 +103,7 @@ class AppRoute extends GoRoute {
|
|||||||
final bool useFade;
|
final bool useFade;
|
||||||
}
|
}
|
||||||
|
|
||||||
String? _handleRedirect(GoRouterState state) {
|
String? _handleRedirect(BuildContext context, GoRouterState state) {
|
||||||
// Prevent anyone from navigating away from `/` if app is starting up.
|
// Prevent anyone from navigating away from `/` if app is starting up.
|
||||||
if (!appLogic.isBootstrapComplete && state.location != ScreenPaths.splash) {
|
if (!appLogic.isBootstrapComplete && state.location != ScreenPaths.splash) {
|
||||||
return ScreenPaths.splash;
|
return ScreenPaths.splash;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user