|
1 | 1 | import 'dart:math';
|
| 2 | +import 'dart:ui'; |
2 | 3 |
|
3 | 4 | import 'package:collection/collection.dart';
|
4 | 5 | import 'package:flutter/material.dart';
|
@@ -597,7 +598,8 @@ class StreamMessageRecipientHeader extends StatelessWidget {
|
597 | 598 | style: const TextStyle(fontWeight: FontWeight.w600)))),
|
598 | 599 | // TODO topic links?
|
599 | 600 | // Then web also has edit/resolve/mute buttons. Skip those for mobile.
|
600 |
| - RecipientHeaderDate(message: message), |
| 601 | + RecipientHeaderDate(message: message, |
| 602 | + color: _kRecipientHeaderDateColor), |
601 | 603 | ])));
|
602 | 604 | }
|
603 | 605 | }
|
@@ -638,33 +640,40 @@ class DmRecipientHeader extends StatelessWidget {
|
638 | 640 | color: _kDmRecipientHeaderColor,
|
639 | 641 | child: Text(style: const TextStyle(color: Colors.white),
|
640 | 642 | title)),
|
641 |
| - RecipientHeaderDate(message: message), |
| 643 | + RecipientHeaderDate(message: message, |
| 644 | + color: _kRecipientHeaderDateColor), |
642 | 645 | ])));
|
643 | 646 | }
|
644 | 647 | }
|
645 | 648 |
|
646 | 649 | final _kDmRecipientHeaderColor = const HSLColor.fromAHSL(1, 0, 0, 0.27).toColor();
|
647 | 650 |
|
648 | 651 | class RecipientHeaderDate extends StatelessWidget {
|
649 |
| - const RecipientHeaderDate({super.key, required this.message}); |
| 652 | + const RecipientHeaderDate({super.key, required this.message, required this.color}); |
650 | 653 |
|
651 | 654 | final Message message;
|
| 655 | + final Color color; |
652 | 656 |
|
653 | 657 | @override
|
654 | 658 | Widget build(BuildContext context) {
|
655 | 659 | return Padding(
|
656 | 660 | padding: const EdgeInsets.fromLTRB(10, 0, 16, 0),
|
657 | 661 | child: Text(
|
658 |
| - style: _kRecipientHeaderDateStyle, |
| 662 | + style: TextStyle( |
| 663 | + color: color, |
| 664 | + fontFamily: 'Source Sans 3', |
| 665 | + fontSize: 16, |
| 666 | + height: (19 / 16), |
| 667 | + // This is equivalent to css `all-small-caps`, see: |
| 668 | + // https://developer.mozilla.org/en-US/docs/Web/CSS/font-variant-caps#all-small-caps |
| 669 | + fontFeatures: const [FontFeature.enable('c2sc'), FontFeature.enable('smcp')], |
| 670 | + ).merge(weightVariableTextStyle(context)), |
659 | 671 | _kRecipientHeaderDateFormat.format(
|
660 | 672 | DateTime.fromMillisecondsSinceEpoch(message.timestamp * 1000))));
|
661 | 673 | }
|
662 | 674 | }
|
663 | 675 |
|
664 |
| -final _kRecipientHeaderDateStyle = TextStyle( |
665 |
| - fontWeight: FontWeight.w600, |
666 |
| - color: const HSLColor.fromAHSL(0.75, 0, 0, 0.15).toColor(), |
667 |
| -); |
| 676 | +final _kRecipientHeaderDateColor = const HSLColor.fromAHSL(0.75, 0, 0, 0.15).toColor(); |
668 | 677 |
|
669 | 678 | final _kRecipientHeaderDateFormat = DateFormat('y-MM-dd', 'en_US'); // TODO(#278)
|
670 | 679 |
|
|
0 commit comments