mirror of
https://github.com/rzuasti/oott.git
synced 2026-07-08 19:21:54 +02:00
Move home screen route from /notifications to /
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
6303951b3d
commit
0304c50efb
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user