Skip to content

Commit 88ffa85

Browse files
committed
fix(headline-details): correct entity details and add country chip
- Update source details link to use correct source entity ID and content type - Add country details chip that navigates to country details page
1 parent 7f49321 commit 88ffa85

File tree

1 file changed

+30
-2
lines changed

1 file changed

+30
-2
lines changed

lib/headline-details/view/headline_details_page.dart

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,8 +425,8 @@ class _HeadlineDetailsPageState extends State<HeadlineDetailsPage> {
425425
context.push(
426426
Routes.sourceDetails,
427427
extra: EntityDetailsPageArguments(
428-
entityId: headline.id,
429-
contentType: ContentType.headline,
428+
entityId: headline.source.id,
429+
contentType: ContentType.source,
430430
),
431431
);
432432
},
@@ -474,6 +474,34 @@ class _HeadlineDetailsPageState extends State<HeadlineDetailsPage> {
474474
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
475475
),
476476
),
477+
)
478+
..add(
479+
InkWell(
480+
onTap: () {
481+
context.push(
482+
Routes.countryDetails,
483+
extra: EntityDetailsPageArguments(
484+
entityId: headline.eventCountry.id,
485+
contentType: ContentType.country,
486+
),
487+
);
488+
},
489+
borderRadius: BorderRadius.circular(AppSpacing.sm),
490+
child: Chip(
491+
avatar: Icon(
492+
Icons.location_city_outlined,
493+
size: chipAvatarSize,
494+
color: chipAvatarColor,
495+
),
496+
label: Text(headline.eventCountry.name),
497+
labelStyle: chipLabelStyle,
498+
backgroundColor: chipBackgroundColor,
499+
padding: chipPadding,
500+
shape: chipShape,
501+
visualDensity: VisualDensity.compact,
502+
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
503+
),
504+
),
477505
);
478506

479507
return chips;

0 commit comments

Comments
 (0)