Skip to content

Commit

Permalink
Merge pull request #1705 from GetStream/fix/reactions-tap
Browse files Browse the repository at this point in the history
  • Loading branch information
xsahil03x authored Aug 16, 2023
2 parents d226964 + 4ea732b commit e5d593a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/stream_chat_flutter/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
✅ Added

- Added support for listening error events in AttachmentPickerBottomSheet.
- Added support for overriding the `MessageWidget.onReactionTap` callback.

## 6.8.1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class StreamMessageWidget extends StatefulWidget {
this.attachmentBorderRadiusGeometry,
this.onMentionTap,
this.onMessageTap,
this.onReactionsTap,
bool? showReactionPicker,
@Deprecated('Use `showReactionPicker` instead')
bool showReactionPickerIndicator = true,
Expand Down Expand Up @@ -563,6 +564,9 @@ class StreamMessageWidget extends StatefulWidget {
/// {@macro onMessageTap}
final void Function(Message)? onMessageTap;

/// {@macro onReactionsTap}
final OnReactionsTap? onReactionsTap;

/// {@template customActions}
/// List of custom actions shown on message long tap
/// {@endtemplate}
Expand Down Expand Up @@ -657,6 +661,7 @@ class StreamMessageWidget extends StatefulWidget {
bool? translateUserAvatar,
OnQuotedMessageTap? onQuotedMessageTap,
void Function(Message)? onMessageTap,
OnReactionsTap? onReactionsTap,
List<StreamMessageAction>? customActions,
void Function(Message message, Attachment attachment)? onAttachmentTap,
Widget Function(BuildContext, User)? userAvatarBuilder,
Expand Down Expand Up @@ -746,6 +751,7 @@ class StreamMessageWidget extends StatefulWidget {
translateUserAvatar: translateUserAvatar ?? this.translateUserAvatar,
onQuotedMessageTap: onQuotedMessageTap ?? this.onQuotedMessageTap,
onMessageTap: onMessageTap ?? this.onMessageTap,
onReactionsTap: onReactionsTap ?? this.onReactionsTap,
customActions: customActions ?? this.customActions,
onAttachmentTap: onAttachmentTap ?? this.onAttachmentTap,
userAvatarBuilder: userAvatarBuilder ?? this.userAvatarBuilder,
Expand Down Expand Up @@ -986,7 +992,11 @@ class _StreamMessageWidgetState extends State<StreamMessageWidget>
showPinHighlight: widget.showPinHighlight,
showReactionPickerTail: widget.showReactionPickerTail,
showReactions: showReactions,
onReactionsTap: () => _showMessageReactionsModal(context),
onReactionsTap: () {
widget.onReactionsTap != null
? widget.onReactionsTap!(widget.message)
: _showMessageReactionsModal(context);
},
showUserAvatar: widget.showUserAvatar,
streamChat: _streamChat,
translateUserAvatar: widget.translateUserAvatar,
Expand Down
5 changes: 5 additions & 0 deletions packages/stream_chat_flutter/lib/src/utils/typedefs.dart
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,11 @@ typedef OnQuotedMessageTap = void Function(String?);
/// {@endtemplate}
typedef OnMessageTap = void Function(Message);

/// {@template onReactionsTap}
/// The action to perform when a message's reactions are tapped.
/// {@endtemplate}
typedef OnReactionsTap = void Function(Message);

/// {@template messageSearchItemTapCallback}
/// The action to perform when tapping or clicking on a user in a
// ignore: deprecated_member_use_from_same_package
Expand Down

0 comments on commit e5d593a

Please sign in to comment.