Skip to content

Commit 8ada8a6

Browse files
committed
msglist [nfc]: Give MessageItem the SizedBox for trailing whitespace
Instead of having its caller make the SizedBox. This way, the whitespace will be naturally included when we give the whole message list's white background color to the individual MessageItems, coming next.
1 parent c1b1cbd commit 8ada8a6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/widgets/message_list.dart

+4-4
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ class _MessageListState extends State<MessageList> with PerAccountStoreAwareStat
330330
case MessageListMessageItem():
331331
return MessageItem(
332332
key: ValueKey(data.message.id),
333-
trailing: i == 1 ? const SizedBox(height: 8) : const SizedBox(height: 11),
333+
trailingWhitespace: i == 1 ? 8 : 11,
334334
item: data);
335335
}
336336
});
@@ -450,11 +450,11 @@ class MessageItem extends StatelessWidget {
450450
const MessageItem({
451451
super.key,
452452
required this.item,
453-
this.trailing,
453+
this.trailingWhitespace,
454454
});
455455

456456
final MessageListMessageItem item;
457-
final Widget? trailing;
457+
final double? trailingWhitespace;
458458

459459
@override
460460
Widget build(BuildContext context) {
@@ -466,7 +466,7 @@ class MessageItem extends StatelessWidget {
466466
isRead: message.flags.contains(MessageFlag.read),
467467
child: Column(children: [
468468
MessageWithPossibleSender(item: item),
469-
if (trailing != null && item.isLastInBlock) trailing!,
469+
if (trailingWhitespace != null && item.isLastInBlock) SizedBox(height: trailingWhitespace!),
470470
])));
471471
}
472472
}

0 commit comments

Comments
 (0)