From 4afc504acacc6e6f2db0ef6ba5425a019e8c118f Mon Sep 17 00:00:00 2001 From: roopak27 Date: Fri, 8 Nov 2024 18:52:05 +0530 Subject: [PATCH] fix(ui): onThreadTap has been added in MessageWidgetContent to enable thread tap action. (#1988) --- packages/stream_chat_flutter/CHANGELOG.md | 1 + .../lib/src/message_widget/message_widget.dart | 1 + .../lib/src/message_widget/message_widget_content.dart | 5 +++++ 3 files changed, 7 insertions(+) diff --git a/packages/stream_chat_flutter/CHANGELOG.md b/packages/stream_chat_flutter/CHANGELOG.md index 1fbb833e7..159bb82c0 100644 --- a/packages/stream_chat_flutter/CHANGELOG.md +++ b/packages/stream_chat_flutter/CHANGELOG.md @@ -21,6 +21,7 @@ - Fixed null errors in web from markdown. - Fixed bug causing background events to be sent in foreground. +- Added `onThreadTap` parameter to `MessageWidgetContent` to enable thread tap action. ## 7.3.0 diff --git a/packages/stream_chat_flutter/lib/src/message_widget/message_widget.dart b/packages/stream_chat_flutter/lib/src/message_widget/message_widget.dart index 0ad1034e1..153451c8d 100644 --- a/packages/stream_chat_flutter/lib/src/message_widget/message_widget.dart +++ b/packages/stream_chat_flutter/lib/src/message_widget/message_widget.dart @@ -726,6 +726,7 @@ class _StreamMessageWidgetState extends State attachmentShape: widget.attachmentShape, onAttachmentTap: widget.onAttachmentTap, onReplyTap: widget.onReplyTap, + onThreadTap: widget.onThreadTap, onShowMessage: widget.onShowMessage, attachmentActionsModalBuilder: widget.attachmentActionsModalBuilder, diff --git a/packages/stream_chat_flutter/lib/src/message_widget/message_widget_content.dart b/packages/stream_chat_flutter/lib/src/message_widget/message_widget_content.dart index 42da724b5..66c76fd6d 100644 --- a/packages/stream_chat_flutter/lib/src/message_widget/message_widget_content.dart +++ b/packages/stream_chat_flutter/lib/src/message_widget/message_widget_content.dart @@ -63,6 +63,7 @@ class MessageWidgetContent extends StatelessWidget { required this.showUsername, required this.showEditedLabel, required this.messageWidget, + required this.onThreadTap, this.onUserAvatarTap, this.borderRadiusGeometry, this.borderSide, @@ -160,6 +161,9 @@ class MessageWidgetContent extends StatelessWidget { /// {@macro onReplyTap} final void Function(Message)? onReplyTap; + /// {@macro onThreadTap} + final void Function(Message)? onThreadTap; + /// {@macro attachmentActionsBuilder} final AttachmentActionsBuilder? attachmentActionsModalBuilder; @@ -429,6 +433,7 @@ class MessageWidgetContent extends StatelessWidget { Widget _buildBottomRow(BuildContext context) { final defaultWidget = BottomRow( + onThreadTap: onThreadTap, message: message, reverse: reverse, messageTheme: messageTheme,