Skip to content

Commit 338ff61

Browse files
committed
msglist [nfc]: Move senderRow to local
1 parent b4ff232 commit 338ff61

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

lib/widgets/message_list.dart

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -853,6 +853,20 @@ class MessageWithPossibleSender extends StatelessWidget {
853853
Widget build(BuildContext context) {
854854
final message = item.message;
855855

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))))
868+
: null;
869+
856870
return GestureDetector(
857871
behavior: HitTestBehavior.translucent,
858872
onLongPress: () => showMessageActionSheet(context: context, message: message),
@@ -875,17 +889,7 @@ class MessageWithPossibleSender extends StatelessWidget {
875889
children: [
876890
if (item.showSender) ...[
877891
const SizedBox(height: 3),
878-
GestureDetector(
879-
onTap: () => Navigator.push(context,
880-
ProfilePage.buildRoute(context: context,
881-
userId: message.senderId)),
882-
child: Text(message.senderFullName, // TODO get from user data
883-
style: const TextStyle(
884-
fontFamily: 'Source Sans 3',
885-
fontSize: 18,
886-
height: (22 / 18),
887-
).merge(weightVariableTextStyle(context, wght: 600,
888-
wghtIfPlatformRequestsBold: 900)))),
892+
senderRow!,
889893
const SizedBox(height: 4),
890894
],
891895
MessageContent(message: message, content: item.content),

0 commit comments

Comments
 (0)