[MessageWidget] Fix thread tail
Signed-off-by: Sahil Kumar <[email protected]>
This commit is contained in:
@@ -278,6 +278,9 @@ class _MessageWidgetState extends State<MessageWidget> {
|
|||||||
?.isNotEmpty ==
|
?.isNotEmpty ==
|
||||||
true;
|
true;
|
||||||
|
|
||||||
|
bool get hasUrlAttachments =>
|
||||||
|
widget.message.attachments?.any((it) => it.ogScrapeUrl != null) == true;
|
||||||
|
|
||||||
bool get showBottomRow =>
|
bool get showBottomRow =>
|
||||||
showThreadReplyIndicator ||
|
showThreadReplyIndicator ||
|
||||||
showUsername ||
|
showUsername ||
|
||||||
@@ -586,12 +589,15 @@ class _MessageWidgetState extends State<MessageWidget> {
|
|||||||
|
|
||||||
if (widget.reverse) children = children.reversed.toList();
|
if (widget.reverse) children = children.reversed.toList();
|
||||||
|
|
||||||
|
final showThreadTail = !(hasUrlAttachments || isGiphy || isOnlyEmoji) &&
|
||||||
|
(showThreadReplyIndicator || showInChannel);
|
||||||
|
|
||||||
return Flex(
|
return Flex(
|
||||||
direction: Axis.horizontal,
|
direction: Axis.horizontal,
|
||||||
clipBehavior: Clip.none,
|
clipBehavior: Clip.none,
|
||||||
crossAxisAlignment: CrossAxisAlignment.end,
|
crossAxisAlignment: CrossAxisAlignment.end,
|
||||||
children: [
|
children: [
|
||||||
if (showThreadReplyIndicator || showInChannel)
|
if (showThreadTail)
|
||||||
Container(
|
Container(
|
||||||
margin: EdgeInsets.only(
|
margin: EdgeInsets.only(
|
||||||
bottom: widget.messageTheme.replies.fontSize / 2,
|
bottom: widget.messageTheme.replies.fontSize / 2,
|
||||||
@@ -938,11 +944,7 @@ class _MessageWidgetState extends State<MessageWidget> {
|
|||||||
: widget.messageTheme,
|
: widget.messageTheme,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (widget.message.attachments
|
if (hasUrlAttachments && !hasQuotedMessage) _buildUrlAttachment(),
|
||||||
?.any((element) => element.ogScrapeUrl != null) ==
|
|
||||||
true &&
|
|
||||||
!hasQuotedMessage)
|
|
||||||
_buildUrlAttachment(),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -955,9 +957,7 @@ class _MessageWidgetState extends State<MessageWidget> {
|
|||||||
return widget.messageTheme.messageBackgroundColor;
|
return widget.messageTheme.messageBackgroundColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (widget.message.attachments
|
if (hasUrlAttachments) {
|
||||||
?.any((element) => element.ogScrapeUrl != null) ==
|
|
||||||
true) {
|
|
||||||
return StreamChatTheme.of(context).colorTheme.blueAlice;
|
return StreamChatTheme.of(context).colorTheme.blueAlice;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user