Skip to content

Commit b8a47b1

Browse files
committed
feat(ui): add delete action to failed message
This commit introduces a new message action that allows users to delete a message that failed to send. The new action is added to the `MessageActionsBuilder` and is only displayed when the message state is `isSendingFailed`.
1 parent 3f7ee96 commit b8a47b1

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

packages/stream_chat_flutter/lib/src/message_action/message_actions_builder.dart

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,17 @@ class StreamMessageActionsBuilder {
7979
),
8080
),
8181
),
82+
if (messageState.isSendingFailed)
83+
StreamMessageAction(
84+
isDestructive: true,
85+
action: HardDeleteMessage(message: message),
86+
leading: const StreamSvgIcon(icon: StreamSvgIcons.delete),
87+
title: Text(
88+
context.translations.toggleDeleteRetryDeleteMessageText(
89+
isDeleteFailed: false,
90+
),
91+
),
92+
),
8293
],
8394
if (message.state.isDeletingFailed)
8495
StreamMessageAction(

0 commit comments

Comments
 (0)