unreadCount property

int unreadCount

Unread count getter.

Implementation

int get unreadCount => currentUserRead?.unreadMessages ?? 0;
void unreadCount=(int count)

Setter for unread count.

Implementation

set unreadCount(int count) {
  final reads = [...read];
  final currentUserReadIndex = reads.indexWhere(_isCurrentUserRead);

  if (currentUserReadIndex < 0) return;

  reads[currentUserReadIndex] =
      reads[currentUserReadIndex].copyWith(unreadMessages: count);
  _channelState = _channelState.copyWith(read: reads);
}