@@ -841,6 +841,9 @@ String formatHeaderDate(
841
841
}
842
842
843
843
/// A Zulip message, showing the sender's name and avatar if specified.
844
+ // Design referenced from:
845
+ // - https://github.com/zulip/zulip-mobile/issues/5511
846
+ // - https://www.figma.com/file/1JTNtYo9memgW7vV6d0ygq/Zulip-Mobile?node-id=538%3A20849&mode=dev
844
847
class MessageWithPossibleSender extends StatelessWidget {
845
848
const MessageWithPossibleSender ({super .key, required this .item});
846
849
@@ -855,7 +858,6 @@ class MessageWithPossibleSender extends StatelessWidget {
855
858
return GestureDetector (
856
859
behavior: HitTestBehavior .translucent,
857
860
onLongPress: () => showMessageActionSheet (context: context, message: message),
858
- // TODO clean up this layout, by less precisely imitating web
859
861
child: Padding (
860
862
padding: const EdgeInsets .only (top: 2 , bottom: 3 , left: 8 , right: 8 ),
861
863
child: Row (crossAxisAlignment: CrossAxisAlignment .start, children: [
@@ -880,7 +882,12 @@ class MessageWithPossibleSender extends StatelessWidget {
880
882
ProfilePage .buildRoute (context: context,
881
883
userId: message.senderId)),
882
884
child: Text (message.senderFullName, // TODO get from user data
883
- style: const TextStyle (fontWeight: FontWeight .bold))),
885
+ style: const TextStyle (
886
+ fontFamily: 'Source Sans 3' ,
887
+ fontSize: 18 ,
888
+ height: (22 / 18 ),
889
+ ).merge (weightVariableTextStyle (context, wght: 600 ,
890
+ wghtIfPlatformRequestsBold: 900 )))),
884
891
const SizedBox (height: 4 ),
885
892
],
886
893
MessageContent (message: message, content: item.content),
@@ -891,19 +898,22 @@ class MessageWithPossibleSender extends StatelessWidget {
891
898
width: 80 ,
892
899
padding: const EdgeInsets .only (top: 4 , right: 16 - 8 ),
893
900
alignment: Alignment .topRight,
894
- child: Text (time, style: _kMessageTimestampStyle)),
901
+ child: Text (time,
902
+ style: TextStyle (
903
+ color: _kMessageTimestampColor,
904
+ fontFamily: 'Source Sans 3' ,
905
+ fontSize: 16 ,
906
+ height: (18 / 16 ),
907
+ fontFeatures: const [FontFeature .enable ('c2sc' ), FontFeature .enable ('smcp' )],
908
+ ).merge (weightVariableTextStyle (context)))),
895
909
])));
896
910
}
897
911
}
898
912
899
913
// TODO web seems to ignore locale in formatting time, but we could do better
900
914
final _kMessageTimestampFormat = DateFormat ('h:mm aa' , 'en_US' );
901
915
902
- // TODO this seems to come out lighter than on web
903
- final _kMessageTimestampStyle = TextStyle (
904
- fontSize: 12 ,
905
- fontWeight: FontWeight .w400,
906
- color: const HSLColor .fromAHSL (0.4 , 0 , 0 , 0.2 ).toColor ());
916
+ final _kMessageTimestampColor = const HSLColor .fromAHSL (1 , 0 , 0 , 0.5 ).toColor ();
907
917
908
918
Future <void > markNarrowAsRead (BuildContext context, Narrow narrow) async {
909
919
final store = PerAccountStoreWidget .of (context);
0 commit comments