Skip to content

Commit ad5a013

Browse files
committed
refactor(router): move settings route under dashboard
- Settings is now a sub-route - Improves navigation structure
1 parent 98e9f32 commit ad5a013

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

lib/router/router.dart

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,17 @@ GoRouter createRouter({
140140
path: Routes.dashboard,
141141
name: Routes.dashboardName,
142142
builder: (context, state) => const DashboardPage(),
143+
routes: [
144+
// The settings page is a sub-route of the dashboard.
145+
// This allows it to be displayed within the AppShell
146+
// (with sidebar and top bar visible) without adding
147+
// a new item to the main navigation sidebar.
148+
GoRoute(
149+
path: Routes.settings,
150+
name: Routes.settingsName,
151+
builder: (context, state) => const SettingsPage(),
152+
),
153+
],
143154
),
144155
],
145156
),
@@ -178,15 +189,6 @@ GoRouter createRouter({
178189
),
179190
],
180191
),
181-
StatefulShellBranch(
182-
routes: [
183-
GoRoute(
184-
path: Routes.settings,
185-
name: Routes.settingsName,
186-
builder: (context, state) => const SettingsPage(),
187-
),
188-
],
189-
),
190192
],
191193
),
192194
],

0 commit comments

Comments
 (0)