@@ -397,6 +397,29 @@ class _HeadlineDetailsPageState extends State<HeadlineDetailsPage> {
397
397
398
398
final chips = < Widget > [];
399
399
400
+ // 1. Add Date Chip First
401
+ if (headline.publishedAt != null ) {
402
+ final formattedDate = DateFormat (
403
+ 'MMM d, yyyy' ,
404
+ ).format (headline.publishedAt! );
405
+ chips.add (
406
+ Chip (
407
+ avatar: Icon (
408
+ Icons .date_range,
409
+ size: chipAvatarSize,
410
+ color: chipAvatarColor,
411
+ ),
412
+ label: Text (formattedDate),
413
+ labelStyle: chipLabelStyle,
414
+ backgroundColor: chipBackgroundColor,
415
+ padding: chipPadding,
416
+ visualDensity: chipVisualDensity,
417
+ materialTapTargetSize: chipMaterialTapTargetSize,
418
+ ),
419
+ );
420
+ }
421
+
422
+ // 2. Add Source Chip Second
400
423
if (headline.source != null ) {
401
424
chips.add (
402
425
GestureDetector (
@@ -423,29 +446,9 @@ class _HeadlineDetailsPageState extends State<HeadlineDetailsPage> {
423
446
);
424
447
}
425
448
426
- if (headline.publishedAt != null ) {
427
- final formattedDate = DateFormat (
428
- 'MMM d, yyyy' ,
429
- ).format (headline.publishedAt! );
430
- chips.add (
431
- Chip (
432
- avatar: Icon (
433
- Icons .date_range,
434
- size: chipAvatarSize,
435
- color: chipAvatarColor,
436
- ),
437
- label: Text (formattedDate),
438
- labelStyle: chipLabelStyle,
439
- backgroundColor: chipBackgroundColor,
440
- padding: chipPadding,
441
- visualDensity: chipVisualDensity,
442
- materialTapTargetSize: chipMaterialTapTargetSize,
443
- ),
444
- );
445
- }
446
-
447
449
// Country chip for headline.source.headquarters removed.
448
450
451
+ // 3. Add Category Chip Third
449
452
if (headline.category != null ) {
450
453
chips.add (
451
454
GestureDetector (
0 commit comments