Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/stream_chat_flutter/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## Upcoming Beta

- Fixed regression in `emoji_code` support for reactions.

## 10.0.0-beta.11

- Included the changes from version [`9.22.0`](https://pub.dev/packages/stream_chat_flutter/changelog).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ class StreamReactionPicker extends StatelessWidget {
return ReactionPickerIcon(
type: reactionType,
builder: reactionIcon.builder,
emojiCode: reactionIcon.emojiCode,
// If the reaction is present in ownReactions, it is selected.
isSelected: ownReactionsMap[reactionType] != null,
);
Expand All @@ -136,9 +137,13 @@ class StreamReactionPicker extends StatelessWidget {
reactionIcons: [...indicatorIcons],
onIconPicked: (reactionIcon) {
final reactionType = reactionIcon.type;
final reaction = ownReactionsMap[reactionType];
final reactionEmojiCode = reactionIcon.emojiCode;
final pickedReaction = switch (ownReactionsMap[reactionType]) {
final reaction? => reaction,
_ => Reaction(type: reactionType, emojiCode: reactionEmojiCode),
};

return onReactionPicked?.call(reaction ?? Reaction(type: reactionType));
return onReactionPicked?.call(pickedReaction);
},
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ class ReactionPickerIcon {
/// {@macro reactionPickerIcon}
const ReactionPickerIcon({
required this.type,
this.emojiCode,
this.isSelected = false,
this.iconSize = 24,
required ReactionIconBuilder builder,
Expand All @@ -209,6 +210,11 @@ class ReactionPickerIcon {
/// The unique identifier for the reaction type (e.g., "like", "love").
final String type;

/// Optional emoji code for the reaction.
///
/// Used to display a custom emoji in the notification.
final String? emojiCode;

/// A boolean indicating whether this reaction is currently selected by the
/// user.
final bool isSelected;
Expand Down