File tree Expand file tree Collapse file tree 5 files changed +28
-3
lines changed Expand file tree Collapse file tree 5 files changed +28
-3
lines changed Original file line number Diff line number Diff line change @@ -14,12 +14,24 @@ final appRouter = GoRouter(
14
14
routes: [
15
15
GoRoute (
16
16
path: Routes .headlinesFeed,
17
+ name: Routes .headlinesFeedName,
17
18
builder: (BuildContext context, GoRouterState state) {
18
19
return const HeadlinesFeedPage ();
19
20
},
21
+ routes: [
22
+ GoRoute (
23
+ path: 'article/:id' ,
24
+ name: Routes .articleDetailsName,
25
+ builder: (BuildContext context, GoRouterState state) {
26
+ final id = state.pathParameters['id' ]! ;
27
+ return Placeholder (child: Text ('Article ID: $id ' ));
28
+ },
29
+ ),
30
+ ],
20
31
),
21
32
GoRoute (
22
33
path: Routes .search,
34
+ name: Routes .searchName,
23
35
builder: (BuildContext context, GoRouterState state) {
24
36
return const Placeholder (
25
37
child: Center (
@@ -30,6 +42,7 @@ final appRouter = GoRouter(
30
42
),
31
43
GoRoute (
32
44
path: Routes .account,
45
+ name: Routes .accountName,
33
46
builder: (BuildContext context, GoRouterState state) {
34
47
return const Placeholder (
35
48
child: Center (
Original file line number Diff line number Diff line change 1
1
abstract final class Routes {
2
2
static const home = '/' ;
3
+ static const homeName = 'home' ;
3
4
static const headlinesFeed = '/headlines-feed' ;
5
+ static const headlinesFeedName = 'headlinesFeed' ;
4
6
static const search = '/search' ;
7
+ static const searchName = 'search' ;
5
8
static const account = '/account' ;
9
+ static const accountName = 'account' ;
10
+ static const articleDetailsName = 'articleDetails' ; // For the sub-route
6
11
}
Original file line number Diff line number Diff line change @@ -17,8 +17,14 @@ Initializing the memory bank. This involves creating the core files and populati
17
17
- Updated ` .clinerules ` with the convention to document no-op operations.
18
18
- Updated ` .clinerules ` with error handling best practices.
19
19
20
+ ## Recent Changes
21
+ - Refactored the router (` lib/router/router.dart ` and ` lib/router/routes.dart ` ):
22
+ - Added ` name ` parameters to ` GoRoute ` definitions for named navigation.
23
+ - Added an example sub-route (` article/:id ` ) to demonstrate detail page routing.
24
+ - Updated the ` Routes ` class to include name constants.
25
+
20
26
## Next Steps
21
- - Update ` progress.md `
27
+ - Update ` progress.md ` .
22
28
23
29
## Active Decisions
24
30
Original file line number Diff line number Diff line change 6
6
- BLoC pattern implementation for state management.
7
7
- Repository pattern for data access.
8
8
- Initial Memory Bank setup.
9
+ - Router refactoring with named navigation and example sub-route.
9
10
- ` headlines-feed ` feature:
10
11
- ` HeadlinesFeedBloc ` for managing headlines data and filtering.
11
12
- ` HeadlinesFeedPage ` and ` _HeadlinesFeedView ` for displaying headlines.
17
18
18
19
- Integration with a real headlines API (currently using an in-memory client).
19
20
- Full implementation of filtering functionality (UI is present, but API integration may be needed).
20
- - Navigation and routing (basic setup exists, but likely needs more work for navigating to article details, etc. ).
21
+ - Navigation and routing (basic setup exists, named navigation implemented, sub-routes need further implementation based on application needs ).
21
22
- Error handling and potentially loading states (basic widgets exist, but more robust handling may be needed).
22
23
- Testing.
23
24
Original file line number Diff line number Diff line change 1
1
name : ht_main
2
2
description : main headlines toolkit mobile app.
3
- version : 0.13 .0
3
+ version : 0.14 .0
4
4
publish_to : none
5
5
repository : https://github.com/headlines-toolkit/ht-main
6
6
environment :
You can’t perform that action at this time.
0 commit comments