@@ -784,6 +784,38 @@ class MessageWithPossibleSender extends StatelessWidget {
784
784
final time = _kMessageTimestampFormat
785
785
.format (DateTime .fromMillisecondsSinceEpoch (1000 * message.timestamp));
786
786
787
+ final Widget senderWidget;
788
+ if (item.showSender) {
789
+ senderWidget = Column (
790
+ children: [
791
+ const SizedBox (height: 3 ),
792
+ GestureDetector (
793
+ onTap: () => Navigator .push (context,
794
+ ProfilePage .buildRoute (context: context,
795
+ userId: message.senderId)),
796
+ child: Row (
797
+ children: [
798
+ Avatar (size: 32 , borderRadius: 3 , userId: message.senderId),
799
+ const SizedBox (width: 8 ),
800
+ Flexible (
801
+ fit: FlexFit .loose,
802
+ child: Text (message.senderFullName, // TODO get from user data
803
+ style: const TextStyle (
804
+ fontFamily: 'Source Sans 3' ,
805
+ fontSize: 18 ,
806
+ height: (22 / 18 ),
807
+ ).merge (weightVariableTextStyle (context, wght: 600 ,
808
+ wghtIfPlatformRequestsBold: 900 )),
809
+ overflow: TextOverflow .ellipsis),
810
+ ),
811
+ ])),
812
+ const SizedBox (height: 4 ),
813
+ ],
814
+ );
815
+ } else {
816
+ senderWidget = const SizedBox .shrink ();
817
+ }
818
+
787
819
return GestureDetector (
788
820
behavior: HitTestBehavior .translucent,
789
821
onLongPress: () => showMessageActionSheet (context: context, message: message),
@@ -795,30 +827,7 @@ class MessageWithPossibleSender extends StatelessWidget {
795
827
child: Column (
796
828
crossAxisAlignment: CrossAxisAlignment .stretch,
797
829
children: [
798
- if (item.showSender) ...[
799
- const SizedBox (height: 3 ),
800
- GestureDetector (
801
- onTap: () => Navigator .push (context,
802
- ProfilePage .buildRoute (context: context,
803
- userId: message.senderId)),
804
- child: Row (
805
- children: [
806
- Avatar (size: 32 , borderRadius: 3 , userId: message.senderId),
807
- const SizedBox (width: 8 ),
808
- Flexible (
809
- fit: FlexFit .loose,
810
- child: Text (message.senderFullName, // TODO get from user data
811
- style: const TextStyle (
812
- fontFamily: 'Source Sans 3' ,
813
- fontSize: 18 ,
814
- height: (22 / 18 ),
815
- ).merge (weightVariableTextStyle (context, wght: 600 ,
816
- wghtIfPlatformRequestsBold: 900 )),
817
- overflow: TextOverflow .ellipsis),
818
- ),
819
- ])),
820
- const SizedBox (height: 4 ),
821
- ],
830
+ senderWidget,
822
831
MessageContent (message: message, content: item.content),
823
832
if ((message.reactions? .total ?? 0 ) > 0 )
824
833
ReactionChipsList (messageId: message.id, reactions: message.reactions! )
0 commit comments