@@ -159,72 +159,62 @@ class _HeadlineMetadataRow extends StatelessWidget {
159
159
Widget build (BuildContext context) {
160
160
final formattedDate = formatRelativeTime (context, headline.publishedAt);
161
161
162
- final metadataStyle = textTheme.bodySmall? .copyWith (
163
- color: colorScheme.onSurfaceVariant,
164
- );
165
- final chipLabelStyle = textTheme.labelSmall? .copyWith (
162
+ // Use labelSmall as a base and make it smaller for metadata text
163
+ final baseTextStyle = textTheme.labelSmall;
164
+ final metadataStyle = baseTextStyle? .copyWith (
166
165
color: colorScheme.onSurfaceVariant,
166
+ fontSize: baseTextStyle.fontSize != null ? baseTextStyle.fontSize! * 0.85 : 10 , // 15% smaller or fallback
167
167
);
168
+ // Use the same derived style for chip labels for consistency
169
+ final chipLabelStyle = metadataStyle;
170
+
168
171
final chipBackgroundColor = colorScheme.surfaceContainerHighest.withOpacity (
169
- 0.5 ,
172
+ 0.7 ,
170
173
);
171
- const iconSize = 12.0 ; // Kept for date icon
174
+ const iconSize = AppSpacing .sm;
172
175
173
176
return Wrap (
174
- spacing: AppSpacing .sm, // Reduced spacing for more compactness
175
- runSpacing: AppSpacing .xs,
177
+ spacing: AppSpacing .xs,
178
+ runSpacing: AppSpacing .xs,
176
179
crossAxisAlignment: WrapCrossAlignment .center,
177
180
children: [
178
181
if (formattedDate.isNotEmpty)
179
- GestureDetector (
180
- onTap: () {
181
- ScaffoldMessenger .of (context)
182
- ..hideCurrentSnackBar ()
183
- ..showSnackBar (
184
- SnackBar (content: Text ('Tapped Date: $formattedDate ' )),
185
- );
186
- },
187
- child: Row (
188
- mainAxisSize: MainAxisSize .min,
189
- children: [
190
- Icon (
191
- Icons .calendar_today_outlined,
192
- size: iconSize,
193
- color: colorScheme.onSurfaceVariant,
194
- ),
195
- const SizedBox (width: AppSpacing .xs),
196
- Text (formattedDate, style: metadataStyle),
197
- ],
198
- ),
182
+ Row (
183
+ mainAxisSize: MainAxisSize .min,
184
+ children: [
185
+ Icon (
186
+ Icons .calendar_today_outlined,
187
+ size: iconSize,
188
+ color: colorScheme.onSurfaceVariant,
189
+ ),
190
+ const SizedBox (width: AppSpacing .xs / 2 ), // Minimal space
191
+ Text (formattedDate, style: metadataStyle),
192
+ ],
199
193
),
200
194
// Conditionally render Category Chip
201
195
if (headline.category? .name != null &&
202
196
! (currentContextEntityType == EntityType .category &&
203
197
headline.category! .id == currentContextEntityId)) ...[
204
- if (formattedDate.isNotEmpty)
198
+ if (formattedDate.isNotEmpty) // Add separator if date was present
205
199
Padding (
206
- padding: const EdgeInsets .symmetric (
207
- horizontal: AppSpacing .xs / 2 ,
208
- ),
200
+ padding: const EdgeInsets .symmetric (horizontal: AppSpacing .xs / 2 ),
209
201
child: Text ('•' , style: metadataStyle),
210
202
),
211
203
GestureDetector (
212
204
onTap: () {
213
205
if (headline.category != null ) {
214
206
context.push (
215
207
Routes .categoryDetails,
216
- extra: EntityDetailsPageArguments (entity: headline.category),
208
+ extra: EntityDetailsPageArguments (entity: headline.category! ),
217
209
);
218
210
}
219
211
},
220
212
child: Chip (
221
213
label: Text (headline.category! .name),
222
214
labelStyle: chipLabelStyle,
223
215
backgroundColor: chipBackgroundColor,
224
- padding: EdgeInsets .zero, // Changed
225
- labelPadding: const EdgeInsets .symmetric (
226
- horizontal: AppSpacing .xs,
227
- ), // Added
216
+ padding: EdgeInsets .zero, // Minimal padding around label
217
+ labelPadding: const EdgeInsets .symmetric (horizontal: AppSpacing .xs / 2 ), // Reduced padding
228
218
visualDensity: VisualDensity .compact,
229
219
materialTapTargetSize: MaterialTapTargetSize .shrinkWrap,
230
220
),
@@ -234,33 +224,29 @@ class _HeadlineMetadataRow extends StatelessWidget {
234
224
if (headline.source? .name != null &&
235
225
! (currentContextEntityType == EntityType .source &&
236
226
headline.source! .id == currentContextEntityId)) ...[
237
- if (formattedDate.isNotEmpty ||
238
- (headline.category? .name != null &&
239
- ! (currentContextEntityType == EntityType .category &&
240
- headline.category! .id == currentContextEntityId)))
227
+ // Add separator if date or category was present
228
+ if (formattedDate.isNotEmpty || (headline.category? .name != null &&
229
+ ! (currentContextEntityType == EntityType .category &&
230
+ headline.category! .id == currentContextEntityId)) )
241
231
Padding (
242
- padding: const EdgeInsets .symmetric (
243
- horizontal: AppSpacing .xs / 2 ,
244
- ),
232
+ padding: const EdgeInsets .symmetric (horizontal: AppSpacing .xs / 2 ),
245
233
child: Text ('•' , style: metadataStyle),
246
234
),
247
235
GestureDetector (
248
236
onTap: () {
249
237
if (headline.source != null ) {
250
238
context.push (
251
239
Routes .sourceDetails,
252
- extra: EntityDetailsPageArguments (entity: headline.source),
240
+ extra: EntityDetailsPageArguments (entity: headline.source! ),
253
241
);
254
242
}
255
243
},
256
244
child: Chip (
257
245
label: Text (headline.source! .name),
258
246
labelStyle: chipLabelStyle,
259
247
backgroundColor: chipBackgroundColor,
260
- padding: EdgeInsets .zero, // Changed
261
- labelPadding: const EdgeInsets .symmetric (
262
- horizontal: AppSpacing .xs,
263
- ), // Added
248
+ padding: EdgeInsets .zero, // Minimal padding around label
249
+ labelPadding: const EdgeInsets .symmetric (horizontal: AppSpacing .xs / 2 ), // Reduced padding
264
250
visualDensity: VisualDensity .compact,
265
251
materialTapTargetSize: MaterialTapTargetSize .shrinkWrap,
266
252
),
0 commit comments