I have received the data from socket but I try to set the reaction to the exist message, it doesnt work. Its no error no somthing so I not sure am I right if I code like this....
try {
//Find message id by waMessageId
final message = Provider.of<ConversationMessageProvider>(
context,
listen: false)
.findWaIdById(waMessageId);
print('Found message with id: ${message?.id}');
//Find the message is exist
final messageExists = chatController!.initialMessageList
.any((msg) => msg.id == message!.id);
print('Message index: $messageExists');
//If exist then set reaction
if (messageExists) {
print('Found message at index: $messageExists');
chatController!.setReaction(
emoji: emoji,
messageId: message!.id.toString(),
userId: senderId);
}
} on Exception catch (e) {
print('Error finding message: $e');
}
I have received the data from socket but I try to set the reaction to the exist message, it doesnt work. Its no error no somthing so I not sure am I right if I code like this....