Skip to content

Commit 8bd29e9

Browse files
committed
refactor(routing): organize route constants for clarity
Reorganized the routes.dart file to improve readability and maintainability. All route path constants are now grouped based on their type: - Top-level routes (absolute paths like /feed) are grouped at the top. - A new // --- Top-Level Modal Routes --- section was created for clarity. - All nested routes (relative paths like article/:id) are now grouped under a new // --- Relative Sub-Routes --- section.
1 parent 720608e commit 8bd29e9

File tree

1 file changed

+20
-14
lines changed

1 file changed

+20
-14
lines changed

lib/router/routes.dart

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,28 @@ abstract final class Routes {
2727
static const entityDetailsName = 'entityDetails';
2828
static const globalArticleDetails = '/article/:id';
2929
static const globalArticleDetailsName = 'globalArticleDetails';
30+
31+
// --- Top-Level Modal Routes ---
32+
static const accountSavedHeadlines = '/saved-headlines';
33+
static const accountSavedHeadlinesName = 'accountSavedHeadlines';
34+
static const accountSavedFilters = '/saved-filters';
35+
static const accountSavedFiltersName = 'accountSavedFilters';
36+
static const settings = '/settings';
37+
static const settingsName = 'settings';
38+
static const manageFollowedItems = '/manage-followed-items';
39+
static const manageFollowedItemsName = 'manageFollowedItems';
40+
41+
// --- Relative Sub-Routes ---
42+
// These routes are defined with relative paths and are intended to be
43+
// nested within other routes.
44+
45+
// Generic
3046
static const multiSelectSearchName = 'multiSelectSearch';
3147

32-
// --- Feed Sub-Routes ---
48+
// Feed
3349
static const articleDetailsName = 'articleDetails';
3450
static const notifications = 'notifications';
3551
static const notificationsName = 'notifications';
36-
37-
// --- Feed Filter Sub-Routes ---
3852
static const feedFilter = 'filter';
3953
static const feedFilterName = 'feedFilter';
4054
static const feedFilterTopics = 'topics';
@@ -45,17 +59,11 @@ abstract final class Routes {
4559
static const feedFilterEventCountries = 'event-countries';
4660
static const feedFilterEventCountriesName = 'feedFilterEventCountries';
4761

48-
// --- Account Sub-Routes ---
49-
static const accountSavedHeadlines = '/saved-headlines';
50-
static const accountSavedHeadlinesName = 'accountSavedHeadlines';
62+
// Account
5163
static const accountArticleDetails = 'article/:id';
5264
static const accountArticleDetailsName = 'accountArticleDetails';
53-
static const accountSavedFilters = '/saved-filters';
54-
static const accountSavedFiltersName = 'accountSavedFilters';
5565

56-
// --- Settings Routes (nested under Account) ---
57-
static const settings = '/settings';
58-
static const settingsName = 'settings';
66+
// Settings
5967
static const settingsAppearance = 'appearance';
6068
static const settingsAppearanceName = 'settingsAppearance';
6169
static const settingsAppearanceTheme = 'theme';
@@ -71,9 +79,7 @@ abstract final class Routes {
7179
static const settingsLanguage = 'language';
7280
static const settingsLanguageName = 'settingsLanguage';
7381

74-
// --- Manage Followed Items Routes (nested under Account) ---
75-
static const manageFollowedItems = '/manage-followed-items';
76-
static const manageFollowedItemsName = 'manageFollowedItems';
82+
// Manage Followed Items
7783
static const followedTopicsList = 'topics';
7884
static const followedTopicsListName = 'followedTopicsList';
7985
static const addTopicToFollow = 'add-topic';

0 commit comments

Comments
 (0)