You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am fetching other user messages from Firebase and showing them in the chat list. but it always indicates streambuilder data messages as my own. I am given the proper author ID but I have the same issue.
where final currentUserIsAuthor = user.id == message.author.id;. I see you pass _user so make sure it's id equals to id of author.id field of a message when you want messages aligned to the right, and not equals if you want messages on the left.
in your logic I also see you do
if (message.author.id != userId) {
log("adding msg");
if (messageList[0].id != message.id) {
messageList.insert(0, message);
}
}
and then you use messageList as message and not snapshot data, so according to your logic you only add messages where message author is not current user, so you will only see messages on the left side
I am fetching other user messages from Firebase and showing them in the chat list. but it always indicates streambuilder data messages as my own. I am given the proper author ID but I have the same issue.
The text was updated successfully, but these errors were encountered: