Skip to content

Commit d59716f

Browse files
committed
msglist [nfc]: Move senderRow to local
Prepare `MessageWithPossibleSender` for upcoming layout changes. This variable does not yet contain a `Row` but will with the changes.
1 parent d7ee48a commit d59716f

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

lib/widgets/message_list.dart

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -852,23 +852,25 @@ class MessageWithPossibleSender extends StatelessWidget {
852852
final time = _kMessageTimestampFormat
853853
.format(DateTime.fromMillisecondsSinceEpoch(1000 * message.timestamp));
854854

855+
final senderRow = item.showSender
856+
? Padding(
857+
padding: const EdgeInsets.fromLTRB(3, 6, 11, 0),
858+
child: GestureDetector(
859+
onTap: () => Navigator.push(context,
860+
ProfilePage.buildRoute(context: context,
861+
userId: message.senderId)),
862+
child: Avatar(size: 35, borderRadius: 4,
863+
userId: message.senderId)))
864+
: const SizedBox(width: 3 + 35 + 11);
865+
855866
return GestureDetector(
856867
behavior: HitTestBehavior.translucent,
857868
onLongPress: () => showMessageActionSheet(context: context, message: message),
858869
// TODO clean up this layout, by less precisely imitating web
859870
child: Padding(
860871
padding: const EdgeInsets.only(top: 2, bottom: 3, left: 8, right: 8),
861872
child: Row(crossAxisAlignment: CrossAxisAlignment.start, children: [
862-
item.showSender
863-
? Padding(
864-
padding: const EdgeInsets.fromLTRB(3, 6, 11, 0),
865-
child: GestureDetector(
866-
onTap: () => Navigator.push(context,
867-
ProfilePage.buildRoute(context: context,
868-
userId: message.senderId)),
869-
child: Avatar(size: 35, borderRadius: 4,
870-
userId: message.senderId)))
871-
: const SizedBox(width: 3 + 35 + 11),
873+
senderRow,
872874
Expanded(
873875
child: Column(
874876
crossAxisAlignment: CrossAxisAlignment.stretch,

0 commit comments

Comments
 (0)