fix: get reaction by user and reaction type

This commit is contained in:
Deven Joshi
2021-01-18 15:06:43 +05:30
parent ade6050a65
commit 85a103c5fc
+5 -2
View File
@@ -31,8 +31,11 @@ class ReactionPicker extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: reactionToEmoji.keys.map((reactionType) {
final ownReactionIndex = message.latestReactions
?.indexWhere((reaction) => reaction.type == reactionType) ??
var user = StreamChat.of(context).user;
final ownReactionIndex = message.latestReactions?.indexWhere(
(reaction) =>
reaction.type == reactionType &&
reaction.userId == user.id) ??
-1;
return Column(
mainAxisSize: MainAxisSize.min,