@@ -7,14 +7,15 @@ import 'package:flutter_bloc/flutter_bloc.dart';
7
7
import 'package:go_router/go_router.dart' ; // Import GoRouter
8
8
import 'package:ht_main/account/bloc/account_bloc.dart' ;
9
9
import 'package:ht_main/app/bloc/app_bloc.dart' ; // Added AppBloc
10
+ import 'package:ht_main/entity_details/view/entity_details_page.dart' ; // Added for Page Arguments
10
11
import 'package:ht_main/headline-details/bloc/headline_details_bloc.dart' ;
11
12
import 'package:ht_main/headline-details/bloc/similar_headlines_bloc.dart' ;
12
13
// HeadlineItemWidget import removed
13
14
import 'package:ht_main/l10n/l10n.dart' ;
14
15
import 'package:ht_main/router/routes.dart' ;
15
16
import 'package:ht_main/shared/shared.dart' ;
16
17
import 'package:ht_shared/ht_shared.dart'
17
- show Headline, HeadlineImageStyle; // Added HeadlineImageStyle
18
+ show Headline, HeadlineImageStyle, Category, Source ; // Added Category, Source
18
19
import 'package:intl/intl.dart' ;
19
20
import 'package:share_plus/share_plus.dart' ; // Import share_plus
20
21
import 'package:url_launcher/url_launcher_string.dart' ;
@@ -394,18 +395,26 @@ class _HeadlineDetailsPageState extends State<HeadlineDetailsPage> {
394
395
395
396
if (headline.source != null ) {
396
397
chips.add (
397
- Chip (
398
- avatar: Icon (
399
- Icons .source,
400
- size: chipAvatarSize,
401
- color: chipAvatarColor,
398
+ GestureDetector ( // Added GestureDetector
399
+ onTap: () {
400
+ context.push (
401
+ Routes .sourceDetails,
402
+ extra: EntityDetailsPageArguments (entity: headline.source! ),
403
+ );
404
+ },
405
+ child: Chip (
406
+ avatar: Icon (
407
+ Icons .source,
408
+ size: chipAvatarSize,
409
+ color: chipAvatarColor,
410
+ ),
411
+ label: Text (headline.source! .name),
412
+ labelStyle: chipLabelStyle,
413
+ backgroundColor: chipBackgroundColor,
414
+ padding: chipPadding,
415
+ visualDensity: chipVisualDensity,
416
+ materialTapTargetSize: chipMaterialTapTargetSize,
402
417
),
403
- label: Text (headline.source! .name),
404
- labelStyle: chipLabelStyle,
405
- backgroundColor: chipBackgroundColor,
406
- padding: chipPadding,
407
- visualDensity: chipVisualDensity,
408
- materialTapTargetSize: chipMaterialTapTargetSize,
409
418
),
410
419
);
411
420
}
@@ -434,7 +443,7 @@ class _HeadlineDetailsPageState extends State<HeadlineDetailsPage> {
434
443
if (headline.source? .headquarters != null ) {
435
444
final country = headline.source! .headquarters! ;
436
445
chips.add (
437
- Chip (
446
+ Chip ( // Country chip is usually not tappable to a details page in this context
438
447
avatar: CircleAvatar (
439
448
radius: chipAvatarSize / 2 ,
440
449
backgroundColor: Colors .transparent,
@@ -453,13 +462,21 @@ class _HeadlineDetailsPageState extends State<HeadlineDetailsPage> {
453
462
454
463
if (headline.category != null ) {
455
464
chips.add (
456
- Chip (
457
- label: Text (headline.category! .name),
458
- labelStyle: chipLabelStyle,
459
- backgroundColor: chipBackgroundColor,
460
- padding: chipPadding,
461
- visualDensity: chipVisualDensity,
462
- materialTapTargetSize: chipMaterialTapTargetSize,
465
+ GestureDetector ( // Added GestureDetector
466
+ onTap: () {
467
+ context.push (
468
+ Routes .categoryDetails,
469
+ extra: EntityDetailsPageArguments (entity: headline.category! ),
470
+ );
471
+ },
472
+ child: Chip (
473
+ label: Text (headline.category! .name),
474
+ labelStyle: chipLabelStyle,
475
+ backgroundColor: chipBackgroundColor,
476
+ padding: chipPadding,
477
+ visualDensity: chipVisualDensity,
478
+ materialTapTargetSize: chipMaterialTapTargetSize,
479
+ ),
463
480
),
464
481
);
465
482
}
0 commit comments