@@ -857,60 +857,64 @@ class MessageWithPossibleSender extends StatelessWidget {
857
857
858
858
Widget ? senderRow;
859
859
if (item.showSender) {
860
- senderRow = GestureDetector (
861
- onTap: () => Navigator .push (context,
862
- ProfilePage .buildRoute (context: context,
863
- userId: message.senderId)),
864
- child: Text (message.senderFullName, // TODO get from user data
865
- style: const TextStyle (
866
- fontFamily: 'Source Sans 3' ,
867
- fontSize: 18 ,
868
- height: (22 / 18 ),
869
- ).merge (weightVariableTextStyle (context, wght: 600 ,
870
- wghtIfPlatformRequestsBold: 900 ))));
860
+ senderRow = Row (
861
+ mainAxisAlignment: MainAxisAlignment .spaceBetween,
862
+ crossAxisAlignment: CrossAxisAlignment .baseline,
863
+ textBaseline: TextBaseline .alphabetic,
864
+ children: [
865
+ Flexible (
866
+ child: GestureDetector (
867
+ onTap: () => Navigator .push (context,
868
+ ProfilePage .buildRoute (context: context,
869
+ userId: message.senderId)),
870
+ child: Row (
871
+ children: [
872
+ Avatar (size: 32 , borderRadius: 3 ,
873
+ userId: message.senderId),
874
+ const SizedBox (width: 8 ),
875
+ Flexible (
876
+ child: Text (message.senderFullName, // TODO get from user data
877
+ style: const TextStyle (
878
+ fontFamily: 'Source Sans 3' ,
879
+ fontSize: 18 ,
880
+ height: (22 / 18 ),
881
+ ).merge (weightVariableTextStyle (context, wght: 600 ,
882
+ wghtIfPlatformRequestsBold: 900 )),
883
+ overflow: TextOverflow .ellipsis)),
884
+ ]))),
885
+ const SizedBox (width: 4 ),
886
+ Text (time,
887
+ style: TextStyle (
888
+ color: _kMessageTimestampColor,
889
+ fontFamily: 'Source Sans 3' ,
890
+ fontSize: 16 ,
891
+ height: (18 / 16 ),
892
+ fontFeatures: const [FontFeature .enable ('c2sc' ), FontFeature .enable ('smcp' )],
893
+ ).merge (weightVariableTextStyle (context))),
894
+ ]);
871
895
}
872
896
873
897
return GestureDetector (
874
898
behavior: HitTestBehavior .translucent,
875
899
onLongPress: () => showMessageActionSheet (context: context, message: message),
876
900
child: Padding (
877
- padding: const EdgeInsets .only (top : 2 , bottom : 3 , left : 8 , right : 8 ),
901
+ padding: const EdgeInsets .symmetric (vertical : 4 ),
878
902
child: Row (crossAxisAlignment: CrossAxisAlignment .start, children: [
879
- item.showSender
880
- ? Padding (
881
- padding: const EdgeInsets .fromLTRB (3 , 6 , 11 , 0 ),
882
- child: GestureDetector (
883
- onTap: () => Navigator .push (context,
884
- ProfilePage .buildRoute (context: context,
885
- userId: message.senderId)),
886
- child: Avatar (size: 35 , borderRadius: 4 ,
887
- userId: message.senderId)))
888
- : const SizedBox (width: 3 + 35 + 11 ),
903
+ const SizedBox (width: 16 ),
889
904
Expanded (
890
905
child: Column (
891
906
crossAxisAlignment: CrossAxisAlignment .stretch,
892
907
children: [
893
- if (item.showSender ) ...[
894
- const SizedBox (height: 3 ),
895
- senderRow! ,
908
+ if (senderRow != null ) ...[
909
+ const SizedBox (height: 2 ),
910
+ senderRow,
896
911
const SizedBox (height: 4 ),
897
912
],
898
913
MessageContent (message: message, content: item.content),
899
914
if ((message.reactions? .total ?? 0 ) > 0 )
900
915
ReactionChipsList (messageId: message.id, reactions: message.reactions! )
901
916
])),
902
- Container (
903
- width: 80 ,
904
- padding: const EdgeInsets .only (top: 4 , right: 16 - 8 ),
905
- alignment: Alignment .topRight,
906
- child: Text (time,
907
- style: TextStyle (
908
- color: _kMessageTimestampColor,
909
- fontFamily: 'Source Sans 3' ,
910
- fontSize: 16 ,
911
- height: (18 / 16 ),
912
- fontFeatures: const [FontFeature .enable ('c2sc' ), FontFeature .enable ('smcp' )],
913
- ).merge (weightVariableTextStyle (context)))),
917
+ const SizedBox (width: 16 ),
914
918
])));
915
919
}
916
920
}
0 commit comments