@@ -448,6 +448,7 @@ class StreamTopicRecipientHeader extends StatelessWidget {
448
448
style: const TextStyle (fontWeight: FontWeight .w600)))),
449
449
// TODO topic links?
450
450
// Then web also has edit/resolve/mute buttons. Skip those for mobile.
451
+ RecipientHeaderDate (message: message),
451
452
])));
452
453
}
453
454
}
@@ -486,17 +487,40 @@ class DmRecipientHeader extends StatelessWidget {
486
487
decoration: BoxDecoration (
487
488
color: Colors .white,
488
489
border: Border .all (color: _kDmRecipientHeaderColor)),
489
- child: Align (
490
- alignment: Alignment .centerLeft,
491
- child: RecipientHeaderChevronContainer (
490
+ child: Row (mainAxisAlignment: MainAxisAlignment .spaceBetween, children: [
491
+ RecipientHeaderChevronContainer (
492
492
color: _kDmRecipientHeaderColor,
493
493
child: Text (style: const TextStyle (color: Colors .white),
494
- title)))));
494
+ title)),
495
+ RecipientHeaderDate (message: message),
496
+ ])));
495
497
}
496
498
}
497
499
498
- final _kDmRecipientHeaderColor =
499
- const HSLColor .fromAHSL (1 , 0 , 0 , 0.27 ).toColor ();
500
+ final _kDmRecipientHeaderColor = const HSLColor .fromAHSL (1 , 0 , 0 , 0.27 ).toColor ();
501
+
502
+ class RecipientHeaderDate extends StatelessWidget {
503
+ const RecipientHeaderDate ({super .key, required this .message});
504
+
505
+ final Message message;
506
+
507
+ @override
508
+ Widget build (BuildContext context) {
509
+ return Padding (
510
+ padding: const EdgeInsets .fromLTRB (10 , 0 , 10 , 0 ),
511
+ child: Text (
512
+ style: _kRecipientHeaderDateStyle,
513
+ _kRecipientHeaderDateFormat.format (
514
+ DateTime .fromMillisecondsSinceEpoch (message.timestamp * 1000 ))));
515
+ }
516
+ }
517
+
518
+ final _kRecipientHeaderDateStyle = TextStyle (
519
+ fontWeight: FontWeight .w600,
520
+ color: const HSLColor .fromAHSL (0.75 , 0 , 0 , 0.15 ).toColor (),
521
+ );
522
+
523
+ final _kRecipientHeaderDateFormat = DateFormat ('y-MM-dd' , 'en_US' ); // TODO(i18n)
500
524
501
525
/// A widget with the distinctive chevron-tailed shape in Zulip recipient headers.
502
526
class RecipientHeaderChevronContainer extends StatelessWidget {
0 commit comments