Merge pull request #492 from GetStream/hotfix/messagewidget

fix: message widget not update when message is updated
This commit is contained in:
Salvatore Giordano
2021-06-23 12:48:42 +02:00
committed by GitHub
2 changed files with 17 additions and 19 deletions
@@ -798,7 +798,7 @@ class MessageInputState extends State<MessageInput> {
setState(() {
_commandEnabled = true;
});
_commandsOverlay!.remove();
_commandsOverlay?.remove();
_commandsOverlay = null;
} else {
_commandsOverlay = _buildCommandsOverlayEntry();
@@ -413,39 +413,37 @@ class _MessageWidgetState extends State<MessageWidget>
bool get showTimeStamp => widget.showTimestamp;
late final bool isMessageRead = widget.readList?.isNotEmpty == true;
bool get isMessageRead => widget.readList?.isNotEmpty == true;
bool get showInChannel => widget.showInChannelIndicator;
bool get hasQuotedMessage => widget.message.quotedMessage != null;
late final bool isSendFailed =
widget.message.status == MessageSendingStatus.failed;
bool get isSendFailed => widget.message.status == MessageSendingStatus.failed;
late final bool isUpdateFailed =
bool get isUpdateFailed =>
widget.message.status == MessageSendingStatus.failed_update;
late final bool isDeleteFailed =
bool get isDeleteFailed =>
widget.message.status == MessageSendingStatus.failed_delete;
late final bool isFailedState =
isSendFailed || isUpdateFailed || isDeleteFailed;
bool get isFailedState => isSendFailed || isUpdateFailed || isDeleteFailed;
late final bool isGiphy =
bool get isGiphy =>
widget.message.attachments.any((element) => element.type == 'giphy') ==
true;
late final bool isOnlyEmoji = widget.message.text?.isOnlyEmoji == true;
late final bool hasNonUrlAttachments = widget.message.attachments
.where((it) => it.ogScrapeUrl == null)
.isNotEmpty ==
true;
late final bool hasUrlAttachments =
bool get isOnlyEmoji => widget.message.text?.isOnlyEmoji == true;
bool get hasNonUrlAttachments => widget.message.attachments
.where((it) => it.ogScrapeUrl == null)
.isNotEmpty;
bool get hasUrlAttachments =>
widget.message.attachments.any((it) => it.ogScrapeUrl != null) == true;
late final bool showBottomRow = showThreadReplyIndicator ||
bool get showBottomRow =>
showThreadReplyIndicator ||
showUsername ||
showTimeStamp ||
showInChannel ||
@@ -1177,7 +1175,7 @@ class _MessageWidgetState extends State<MessageWidget>
);
}
late final bool isPinned = widget.message.pinned;
bool get isPinned => widget.message.pinned;
Color? _getBackgroundColor() {
if (hasQuotedMessage) {