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