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 Category model
3
+
4
+ /// A simple widget to display a Category search result.
5
+ class CategoryItemWidget extends StatelessWidget {
6
+ const CategoryItemWidget ({required this .category, super .key});
7
+
8
+ final Category category;
9
+
10
+ @override
11
+ Widget build (BuildContext context) {
12
+ return ListTile (
13
+ title: Text (category.name),
14
+ subtitle: category.description != null
15
+ ? Text (
16
+ category.description! ,
17
+ maxLines: 2 ,
18
+ overflow: TextOverflow .ellipsis,
19
+ )
20
+ : null ,
21
+ // TODO(you): Implement onTap navigation if needed for categories
22
+ onTap: () {
23
+ // Example: Navigate to a filtered feed for this category
24
+ // context.goNamed('someCategoryFeedRoute', params: {'id': category.id});
25
+ ScaffoldMessenger .of (context).showSnackBar (
26
+ SnackBar (content: Text ('Tapped on category: ${category .name }' )),
27
+ );
28
+ },
29
+ );
30
+ }
31
+ }
You can’t perform that action at this time.
0 commit comments