File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
lib/headlines-feed/widgets Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change 1
1
import 'package:flutter/material.dart' ;
2
2
import 'package:go_router/go_router.dart' ;
3
- import 'package:ht_headlines_client/ht_headlines_client.dart' show Headline;
4
3
import 'package:ht_main/router/routes.dart' ;
5
4
import 'package:ht_main/shared/constants/constants.dart' ; // Import AppSpacing
5
+ import 'package:ht_shared/ht_shared.dart' ; // Import models from ht_shared
6
6
import 'package:intl/intl.dart' ; // For date formatting
7
7
8
8
/// A widget that displays a single headline with enhanced styling.
@@ -134,10 +134,19 @@ class HeadlineItemWidget extends StatelessWidget {
134
134
icon: Icons .category_outlined,
135
135
text: headline.category! .name,
136
136
),
137
- if (headline.eventCountry != null )
137
+ if (headline.source? .headquarters !=
138
+ null ) // Use source?.headquarters
138
139
_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
141
150
),
142
151
],
143
152
),
You can’t perform that action at this time.
0 commit comments