@@ -855,6 +855,35 @@ class MessageWithPossibleSender extends StatelessWidget {
855
855
final time = _kMessageTimestampFormat
856
856
.format (DateTime .fromMillisecondsSinceEpoch (1000 * message.timestamp));
857
857
858
+ final Widget ? senderRow = item.showSender
859
+ ? Row (
860
+ children: [
861
+ GestureDetector (
862
+ onTap: () => Navigator .push (context,
863
+ ProfilePage .buildRoute (context: context,
864
+ userId: message.senderId)),
865
+ child: Row (
866
+ children: [
867
+ Avatar (size: 35 , borderRadius: 4 ,
868
+ userId: message.senderId),
869
+ Text (message.senderFullName, // TODO get from user data
870
+ style: const TextStyle (
871
+ fontFamily: 'Source Sans 3' ,
872
+ fontSize: 18 ,
873
+ height: (22 / 18 ),
874
+ ).merge (weightVariableTextStyle (context, wght: 600 ,
875
+ wghtIfPlatformRequestsBold: 900 ))),
876
+ ])),
877
+ Text (time,
878
+ style: TextStyle (
879
+ color: _kMessageTimestampColor,
880
+ fontFamily: 'Source Sans 3' ,
881
+ fontSize: 16 ,
882
+ height: (18 / 16 ),
883
+ fontFeatures: const [FontFeature .enable ('c2sc' ), FontFeature .enable ('smcp' )],
884
+ ).merge (weightVariableTextStyle (context))),
885
+ ])
886
+ : null ;
858
887
return GestureDetector (
859
888
behavior: HitTestBehavior .translucent,
860
889
onLongPress: () => showMessageActionSheet (context: context, message: message),
@@ -868,33 +897,7 @@ class MessageWithPossibleSender extends StatelessWidget {
868
897
children: [
869
898
if (item.showSender) ...[
870
899
const SizedBox (height: 3 ),
871
- Row (
872
- children: [
873
- GestureDetector (
874
- onTap: () => Navigator .push (context,
875
- ProfilePage .buildRoute (context: context,
876
- userId: message.senderId)),
877
- child: Row (
878
- children: [
879
- Avatar (size: 35 , borderRadius: 4 ,
880
- userId: message.senderId),
881
- Text (message.senderFullName, // TODO get from user data
882
- style: const TextStyle (
883
- fontFamily: 'Source Sans 3' ,
884
- fontSize: 18 ,
885
- height: (22 / 18 ),
886
- ).merge (weightVariableTextStyle (context, wght: 600 ,
887
- wghtIfPlatformRequestsBold: 900 ))),
888
- ])),
889
- Text (time,
890
- style: TextStyle (
891
- color: _kMessageTimestampColor,
892
- fontFamily: 'Source Sans 3' ,
893
- fontSize: 16 ,
894
- height: (18 / 16 ),
895
- fontFeatures: const [FontFeature .enable ('c2sc' ), FontFeature .enable ('smcp' )],
896
- ).merge (weightVariableTextStyle (context))),
897
- ]),
900
+ if (senderRow != null ) senderRow,
898
901
const SizedBox (height: 4 ),
899
902
],
900
903
MessageContent (message: message, content: item.content),
0 commit comments