From c8fe66e12a76f88d89fe4a617d75dbeb68d605c9 Mon Sep 17 00:00:00 2001 From: Chris Bobbe Date: Mon, 20 Nov 2023 11:31:12 -0500 Subject: [PATCH] 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. --- lib/widgets/message_list.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/widgets/message_list.dart b/lib/widgets/message_list.dart index 7fc08c0174..4ddc99ae60 100644 --- a/lib/widgets/message_list.dart +++ b/lib/widgets/message_list.dart @@ -330,7 +330,7 @@ class _MessageListState extends State with PerAccountStoreAwareStat case MessageListMessageItem(): return MessageItem( key: ValueKey(data.message.id), - trailing: i == 1 ? const SizedBox(height: 8) : const SizedBox(height: 11), + trailingWhitespace: i == 1 ? 8 : 11, item: data); } }); @@ -450,11 +450,11 @@ class MessageItem extends StatelessWidget { const MessageItem({ super.key, required this.item, - this.trailing, + this.trailingWhitespace, }); final MessageListMessageItem item; - final Widget? trailing; + final double? trailingWhitespace; @override Widget build(BuildContext context) { @@ -466,7 +466,7 @@ class MessageItem extends StatelessWidget { isRead: message.flags.contains(MessageFlag.read), child: Column(children: [ MessageWithPossibleSender(item: item), - if (trailing != null && item.isLastInBlock) trailing!, + if (trailingWhitespace != null && item.isLastInBlock) SizedBox(height: trailingWhitespace!), ]))); } }