File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
lib/headlines-search/widgets Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change
1
+ import 'package:flutter/material.dart' ;
2
+ import 'package:ht_shared/ht_shared.dart' ; // Import Source model
3
+
4
+ /// A simple widget to display a Source search result.
5
+ class SourceItemWidget extends StatelessWidget {
6
+ const SourceItemWidget ({required this .source, super .key});
7
+
8
+ final Source source;
9
+
10
+ @override
11
+ Widget build (BuildContext context) {
12
+ return ListTile (
13
+ title: Text (source.name),
14
+ subtitle: source.description != null
15
+ ? Text (
16
+ source.description! ,
17
+ maxLines: 2 ,
18
+ overflow: TextOverflow .ellipsis,
19
+ )
20
+ : null ,
21
+ // TODO(you): Implement onTap navigation if needed for sources
22
+ onTap: () {
23
+ // Example: Navigate to a page showing headlines from this source
24
+ // context.goNamed('someSourceFeedRoute', params: {'id': source.id});
25
+ ScaffoldMessenger .of (context).showSnackBar (
26
+ SnackBar (content: Text ('Tapped on source: ${source .name }' )),
27
+ );
28
+ },
29
+ );
30
+ }
31
+ }
You can’t perform that action at this time.
0 commit comments