Skip to content

Commit 67a9470

Browse files
committed
feat(search): navigate to source details page
- Navigate to entity details - Pass source as entity argument
1 parent 59b965c commit 67a9470

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

lib/headlines-search/widgets/source_item_widget.dart

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
import 'package:flutter/material.dart';
2+
import 'package:go_router/go_router.dart'; // Added
3+
import 'package:ht_main/entity_details/view/entity_details_page.dart'; // Added
4+
import 'package:ht_main/router/routes.dart'; // Added
25
import 'package:ht_shared/ht_shared.dart'; // Import Source model
36

47
/// A simple widget to display a Source search result.
@@ -19,12 +22,10 @@ class SourceItemWidget extends StatelessWidget {
1922
overflow: TextOverflow.ellipsis,
2023
)
2124
: null,
22-
// TODO(you): Implement onTap navigation if needed for sources
2325
onTap: () {
24-
// Example: Navigate to a page showing headlines from this source
25-
// context.goNamed('someSourceFeedRoute', params: {'id': source.id});
26-
ScaffoldMessenger.of(context).showSnackBar(
27-
SnackBar(content: Text('Tapped on source: ${source.name}')),
26+
context.push(
27+
Routes.sourceDetails,
28+
extra: EntityDetailsPageArguments(entity: source),
2829
);
2930
},
3031
);

0 commit comments

Comments
 (0)