Skip to content

Commit faaee80

Browse files
committed
feat(router): add edit headline route
- Added edit headline route - Added edit headline name
1 parent c310425 commit faaee80

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

lib/router/router.dart

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ GoRouter createRouter({
4848
const authenticationPath = Routes.authentication;
4949
const dashboardPath = Routes.dashboard;
5050
final isGoingToAuth = currentLocation.startsWith(authenticationPath);
51-
final isGoingToDashboard = currentLocation.startsWith(dashboardPath);
5251

5352
// --- Case 1: Unauthenticated User ---
5453
if (appStatus == AppStatus.unauthenticated ||
@@ -97,7 +96,6 @@ GoRouter createRouter({
9796
path: Routes.authentication,
9897
name: Routes.authenticationName,
9998
builder: (BuildContext context, GoRouterState state) {
100-
final l10n = context.l10n;
10199
const headline = 'Sign In to Dashboard';
102100
const subHeadline = 'Enter your email to get a verification code.';
103101
const showAnonymousButton = false;
@@ -175,6 +173,16 @@ GoRouter createRouter({
175173
title: 'Create New Headline',
176174
), // Placeholder
177175
),
176+
GoRoute(
177+
path: Routes.editHeadline,
178+
name: Routes.editHeadlineName,
179+
builder: (context, state) {
180+
final id = state.pathParameters['id']!;
181+
return PlaceholderCreatePage(
182+
title: 'Edit Headline $id',
183+
); // Placeholder
184+
},
185+
),
178186
],
179187
),
180188
GoRoute(

lib/router/routes.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ abstract final class Routes {
5656
/// The name for the create headline page route.
5757
static const String createHeadlineName = 'createHeadline';
5858

59+
/// The path for editing an existing headline.
60+
static const String editHeadline = 'edit-headline/:id';
61+
62+
/// The name for the edit headline page route.
63+
static const String editHeadlineName = 'editHeadline';
64+
5965
/// The path for the categories page within content management.
6066
static const String categories = 'categories';
6167

0 commit comments

Comments
 (0)