Fix navigation order for Terminal and Settings pages

Corrects the navigation indices for Terminal (Logs) and Settings pages in both desktop and mobile dashboards and navbars, ensuring consistent navigation and page rendering.
This commit is contained in:
Ankit Mahato
2025-09-28 15:12:22 +05:30
parent 447085be0c
commit 99e6d43f32
3 changed files with 11 additions and 8 deletions

View File

@@ -73,9 +73,9 @@ class Dashboard extends ConsumerWidget {
),
kVSpacer10,
IconButton(
isSelected: railIdx == 4,
isSelected: railIdx == 3,
onPressed: () {
ref.read(navRailIndexStateProvider.notifier).state = 4;
ref.read(navRailIndexStateProvider.notifier).state = 3;
},
icon: const Icon(Icons.terminal),
selectedIcon: const Icon(Icons.terminal),
@@ -108,7 +108,7 @@ class Dashboard extends ConsumerWidget {
padding: const EdgeInsets.only(bottom: 16.0),
child: NavbarButton(
railIdx: railIdx,
buttonIdx: 3,
buttonIdx: 4,
selectedIcon: Icons.settings,
icon: Icons.settings_outlined,
label: 'Settings',
@@ -134,8 +134,8 @@ class Dashboard extends ConsumerWidget {
HomePage(),
EnvironmentPage(),
HistoryPage(),
SettingsPage(),
TerminalPage(),
SettingsPage(),
],
),
)

View File

@@ -74,12 +74,15 @@ class PageBranch extends ConsumerWidget {
case 2:
return const HistoryPage();
case 3:
return const PageBase(
title: 'Logs',
scaffoldBody: TerminalPage(),
);
case 4:
return const PageBase(
title: 'Settings',
scaffoldBody: SettingsPage(),
);
case 4:
return const TerminalPage();
default:
return const RequestResponsePage();
}

View File

@@ -60,7 +60,7 @@ class BottomNavBar extends ConsumerWidget {
Expanded(
child: NavbarButton(
railIdx: railIdx,
buttonIdx: 4,
buttonIdx: 3,
selectedIcon: Icons.terminal,
icon: Icons.terminal,
label: 'Logs',
@@ -69,7 +69,7 @@ class BottomNavBar extends ConsumerWidget {
Expanded(
child: NavbarButton(
railIdx: railIdx,
buttonIdx: 3,
buttonIdx: 4,
selectedIcon: Icons.settings,
icon: Icons.settings_outlined,
label: 'Settings',