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