Skip to content

Commit 8808a9c

Browse files
committed
feat(feed): Show source headquarters in feed
- Updated country source - Used source headquarters
1 parent 728d9cf commit 8808a9c

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

lib/headlines-feed/widgets/headline_item_widget.dart

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import 'package:flutter/material.dart';
22
import 'package:go_router/go_router.dart';
3-
import 'package:ht_headlines_client/ht_headlines_client.dart' show Headline;
43
import 'package:ht_main/router/routes.dart';
54
import 'package:ht_main/shared/constants/constants.dart'; // Import AppSpacing
5+
import 'package:ht_shared/ht_shared.dart'; // Import models from ht_shared
66
import 'package:intl/intl.dart'; // For date formatting
77

88
/// A widget that displays a single headline with enhanced styling.
@@ -134,10 +134,19 @@ class HeadlineItemWidget extends StatelessWidget {
134134
icon: Icons.category_outlined,
135135
text: headline.category!.name,
136136
),
137-
if (headline.eventCountry != null)
137+
if (headline.source?.headquarters !=
138+
null) // Use source?.headquarters
138139
_CountryMetadataItem(
139-
flagUrl: headline.eventCountry!.flagUrl,
140-
countryName: headline.eventCountry!.name,
140+
flagUrl:
141+
headline
142+
.source!
143+
.headquarters!
144+
.flagUrl, // Access flagUrl from headquarters
145+
countryName:
146+
headline
147+
.source!
148+
.headquarters!
149+
.name, // Access name from headquarters
141150
),
142151
],
143152
),

0 commit comments

Comments
 (0)