diff --git a/apps/mobile_app/lib/core/init_app.dart b/apps/mobile_app/lib/core/init_app.dart index 7055fa2a..753099cb 100644 --- a/apps/mobile_app/lib/core/init_app.dart +++ b/apps/mobile_app/lib/core/init_app.dart @@ -39,7 +39,7 @@ Future initApp(EnvironmentEnum env) async { await GetIt.I().logout(); } catch (_) {} await clearSessionData(); - appRouter.go(AppRoutes.legacyLogin); + appRouter.go(AppRoutes.login); }, ); diff --git a/apps/mobile_app/lib/navigation/app_router.dart b/apps/mobile_app/lib/navigation/app_router.dart index 819d2857..4657edb7 100644 --- a/apps/mobile_app/lib/navigation/app_router.dart +++ b/apps/mobile_app/lib/navigation/app_router.dart @@ -21,6 +21,25 @@ import 'package:splash/splash.dart'; final GlobalKey rootNavigatorKey = GlobalKey(); +final _legacyControlPanelNavKey = + GlobalKey(debugLabel: 'legacyControlPanel'); +final _legacyDeviceMgmtNavKey = + GlobalKey(debugLabel: 'legacyDeviceMgmt'); +final _legacyLocationNavKey = + GlobalKey(debugLabel: 'legacyLocation'); +final _legacyChatNavKey = GlobalKey(debugLabel: 'legacyChat'); +final _legacySettingsNavKey = + GlobalKey(debugLabel: 'legacySettings'); + +final _dashboardHomeNavKey = + GlobalKey(debugLabel: 'dashboardHome'); +final _dashboardActivityNavKey = + GlobalKey(debugLabel: 'dashboardActivity'); +final _dashboardNotificationsNavKey = + GlobalKey(debugLabel: 'dashboardNotifications'); +final _dashboardProfileNavKey = + GlobalKey(debugLabel: 'dashboardProfile'); + late final GoRouter appRouter; void configureAppRouter() { @@ -40,6 +59,7 @@ void configureAppRouter() { }, branches: [ StatefulShellBranch( + navigatorKey: _legacyControlPanelNavKey, routes: [ GoRoute( path: AppRoutes.controlPanel, @@ -88,6 +108,7 @@ void configureAppRouter() { ], ), StatefulShellBranch( + navigatorKey: _legacyDeviceMgmtNavKey, routes: [ GoRoute( path: AppRoutes.deviceManagement, @@ -156,6 +177,7 @@ void configureAppRouter() { ], ), StatefulShellBranch( + navigatorKey: _legacyLocationNavKey, routes: [ GoRoute( path: AppRoutes.legacyLocation, @@ -166,6 +188,7 @@ void configureAppRouter() { ), // TODO: AƱadir branch para Chat (tab 4) StatefulShellBranch( + navigatorKey: _legacyChatNavKey, routes: [ GoRoute( path: '${AppRoutes.legacyDashboard}/chat', @@ -180,6 +203,7 @@ void configureAppRouter() { ], ), StatefulShellBranch( + navigatorKey: _legacySettingsNavKey, routes: [ GoRoute( path: AppRoutes.settings, @@ -355,6 +379,7 @@ void configureAppRouter() { }, branches: [ StatefulShellBranch( + navigatorKey: _dashboardHomeNavKey, routes: [ GoRoute( path: AppRoutes.dashboardHome, @@ -427,6 +452,7 @@ void configureAppRouter() { ], ), StatefulShellBranch( + navigatorKey: _dashboardActivityNavKey, routes: [ GoRoute( path: AppRoutes.dashboardActivity, @@ -436,6 +462,7 @@ void configureAppRouter() { ], ), StatefulShellBranch( + navigatorKey: _dashboardNotificationsNavKey, routes: [ GoRoute( path: AppRoutes.dashboardNotifications, @@ -445,6 +472,7 @@ void configureAppRouter() { ], ), StatefulShellBranch( + navigatorKey: _dashboardProfileNavKey, routes: [ GoRoute( path: AppRoutes.dashboardProfile,