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
|
// Routes definitions
|
||||||
final GoRouter router = GoRouter(
|
final GoRouter router = GoRouter(
|
||||||
initialLocation: '/notifications',
|
initialLocation: '/',
|
||||||
routes: [
|
routes: [
|
||||||
ShellRoute(
|
ShellRoute(
|
||||||
observers: [routeObserver],
|
observers: [routeObserver],
|
||||||
@@ -52,8 +52,8 @@ final GoRouter router = GoRouter(
|
|||||||
},
|
},
|
||||||
routes: [
|
routes: [
|
||||||
GoRoute(
|
GoRoute(
|
||||||
path: '/notifications',
|
path: '/',
|
||||||
name: 'notifications',
|
name: 'home',
|
||||||
builder: (context, state) => const HomeScreen(),
|
builder: (context, state) => const HomeScreen(),
|
||||||
redirect: (context, state) => _redirectToSettings(),
|
redirect: (context, state) => _redirectToSettings(),
|
||||||
),
|
),
|
||||||
@@ -218,7 +218,7 @@ String? _redirectToSettings() {
|
|||||||
|
|
||||||
int _calculateSelectedIndex(BuildContext context) {
|
int _calculateSelectedIndex(BuildContext context) {
|
||||||
final location = GoRouterState.of(context).uri.path;
|
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('/devices')) return 1;
|
||||||
if (location.startsWith('/status')) return 2;
|
if (location.startsWith('/status')) return 2;
|
||||||
if (location.startsWith('/settings')) return 3;
|
if (location.startsWith('/settings')) return 3;
|
||||||
@@ -229,7 +229,7 @@ int _calculateSelectedIndex(BuildContext context) {
|
|||||||
void _onDestinationSelected(int index, BuildContext context) {
|
void _onDestinationSelected(int index, BuildContext context) {
|
||||||
switch (index) {
|
switch (index) {
|
||||||
case 0:
|
case 0:
|
||||||
context.go('/notifications');
|
context.go('/');
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
context.go('/devices');
|
context.go('/devices');
|
||||||
|
|||||||
Reference in New Issue
Block a user