update sending indicator

This commit is contained in:
Salvatore Giordano
2020-06-18 11:03:28 +02:00
parent 5b5c390c82
commit 8fc314d942
5 changed files with 45 additions and 17 deletions
+5 -4
View File
@@ -426,10 +426,8 @@ class _MessageListViewState extends State<MessageListView> {
final isNextUser =
index - 1 >= 0 && message.user.id == messages[index - 1]?.user?.id;
final readList = StreamChannel.of(context)
.channel
.state
.read
var channel = StreamChannel.of(context).channel;
final readList = channel.state.read
.where((element) => element.user.id != userId)
.where((read) =>
read.lastRead.isAfter(message.createdAt) &&
@@ -437,6 +435,8 @@ class _MessageListViewState extends State<MessageListView> {
read.lastRead.isBefore(messages[index - 1].createdAt)))
.toList();
final allRead = readList.length == channel.memberCount - 1;
return MessageWidget(
message: message,
reverse: isMyMessage,
@@ -470,6 +470,7 @@ class _MessageListViewState extends State<MessageListView> {
? StreamChatTheme.of(context).ownMessageTheme
: StreamChatTheme.of(context).otherMessageTheme,
readList: readList,
allRead: allRead,
);
}