From 16615705b184cafc68b139c9cdb540405cdfdf39 Mon Sep 17 00:00:00 2001 From: Gordon Hayes Date: Fri, 25 Nov 2022 17:58:03 +0100 Subject: [PATCH] fix: on reply callback not used --- packages/stream_chat_flutter/CHANGELOG.md | 2 ++ packages/stream_chat_flutter/example/lib/main.dart | 1 + .../attachment_actions_modal.dart | 8 +++++--- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/stream_chat_flutter/CHANGELOG.md b/packages/stream_chat_flutter/CHANGELOG.md index 74b0bf10..2b5605b6 100644 --- a/packages/stream_chat_flutter/CHANGELOG.md +++ b/packages/stream_chat_flutter/CHANGELOG.md @@ -2,6 +2,8 @@ 🐞 Fixed - Fix render overflow issue with `MessageSearchListTileTitle`. It now uses `Text.rich` instead of `Row`. Better default behaviour and allows `TextOverflow`. +- Fix [[#1347]](https://github.com/GetStream/stream-chat-flutter/issues/1347) `onReply` not working in `AttachmentActionsModal` which is used by `StreamImageAttachment` and `StreamImageGroup`. + ## 5.1.0 🐞 Fixed diff --git a/packages/stream_chat_flutter/example/lib/main.dart b/packages/stream_chat_flutter/example/lib/main.dart index 67420d06..c8978a45 100644 --- a/packages/stream_chat_flutter/example/lib/main.dart +++ b/packages/stream_chat_flutter/example/lib/main.dart @@ -300,6 +300,7 @@ class _ChannelPageState extends State { @override void dispose() { focusNode.dispose(); + messageInputController.dispose(); super.dispose(); } } diff --git a/packages/stream_chat_flutter/lib/src/attachment_actions_modal/attachment_actions_modal.dart b/packages/stream_chat_flutter/lib/src/attachment_actions_modal/attachment_actions_modal.dart index 510d2fe4..47a62a32 100644 --- a/packages/stream_chat_flutter/lib/src/attachment_actions_modal/attachment_actions_modal.dart +++ b/packages/stream_chat_flutter/lib/src/attachment_actions_modal/attachment_actions_modal.dart @@ -33,10 +33,10 @@ class AttachmentActionsModal extends StatelessWidget { /// Callback to download [attachment]. final AttachmentDownloader? attachmentDownloader; - /// Show reply option + /// Show "reply" option final bool showReply; - /// Show show in chat option + /// Show "show in chat" option final bool showShowInChat; /// Show save option @@ -55,6 +55,7 @@ class AttachmentActionsModal extends StatelessWidget { Attachment? attachment, Message? message, VoidCallback? onShowMessage, + VoidCallback? onReply, AttachmentDownloader? attachmentDownloader, bool? showReply, bool? showShowInChat, @@ -67,6 +68,7 @@ class AttachmentActionsModal extends StatelessWidget { attachment: attachment ?? this.attachment, message: message ?? this.message, onShowMessage: onShowMessage ?? this.onShowMessage, + onReply: onReply ?? this.onReply, attachmentDownloader: attachmentDownloader ?? this.attachmentDownloader, showReply: showReply ?? this.showReply, showShowInChat: showShowInChat ?? this.showShowInChat, @@ -112,7 +114,7 @@ class AttachmentActionsModal extends StatelessWidget { size: 24, color: theme.colorTheme.textLowEmphasis, ), - () => Navigator.of(context).pop(ReturnActionType.reply), + onReply, ), if (showShowInChat) _buildButton(