Move home screen route from /notifications to /

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
rzuasti
2026-06-01 07:17:41 -04:00
co-authored by Claude Opus 4.7
parent 6303951b3d
commit 0304c50efb
+5 -5
View File
@@ -43,7 +43,7 @@ final RouteObserver<ModalRoute<void>> routeObserver =
// Routes definitions
final GoRouter router = GoRouter(
initialLocation: '/notifications',
initialLocation: '/',
routes: [
ShellRoute(
observers: [routeObserver],
@@ -52,8 +52,8 @@ final GoRouter router = GoRouter(
},
routes: [
GoRoute(
path: '/notifications',
name: 'notifications',
path: '/',
name: 'home',
builder: (context, state) => const HomeScreen(),
redirect: (context, state) => _redirectToSettings(),
),
@@ -218,7 +218,7 @@ String? _redirectToSettings() {
int _calculateSelectedIndex(BuildContext context) {
final location = GoRouterState.of(context).uri.path;
if (location.startsWith('/notifications')) return 0;
if (location == '/') return 0;
if (location.startsWith('/devices')) return 1;
if (location.startsWith('/status')) return 2;
if (location.startsWith('/settings')) return 3;
@@ -229,7 +229,7 @@ int _calculateSelectedIndex(BuildContext context) {
void _onDestinationSelected(int index, BuildContext context) {
switch (index) {
case 0:
context.go('/notifications');
context.go('/');
break;
case 1:
context.go('/devices');