ChannelClientState class

The class that handles the state of the channel listening to the events.

Available extensions

Constructors

ChannelClientState(Channel _channel, ChannelState channelState)
Creates a new instance listening to events and updating the state.

Properties

channelState ChannelState
The channel state related to this client.
no setter
channelStateStream Stream<ChannelState>
The channel state related to this client as a stream.
no setter
currentUserChannelRole String?
Channel role for the current user
no setter
currentUserMember Member?
Channel member for the current user.
no setter
currentUserRead Read?
Channel read for the logged in user.
no setter
currentUserReadStream Stream<Read?>
Channel read for the logged in user as a stream.
no setter
draft Draft?
Channel draft.
no setter
draftStream Stream<Draft?>
Channel draft as a stream.
no setter
hashCode int
The hash code for this object.
no setterinherited
isUpToDate bool
Flag which indicates if ChannelClientState contain latest/recent messages or not.
getter/setter pair
isUpToDateStream Stream<bool>
isUpToDate flag count as a stream.
no setter
lastMessage Message?
Get channel last message.
no setter
lastMessageStream Stream<Message?>
Get channel last message as a stream.
no setter
members List<Member>
Channel members list.
no setter
membersStream Stream<List<Member>>
Channel members list as a stream.
no setter
messages List<Message>
Channel message list.
no setter
messagesStream Stream<List<Message>>
Channel message list as a stream.
no setter
pendingMessages List<Message>
Channel pending message list.
no setter
pendingMessagesStream Stream<List<Message>>
Channel pending message list as a stream.
no setter
pinnedMessages List<Message>
Channel pinned message list.
no setter
pinnedMessagesStream Stream<List<Message>>
Channel pinned message list as a stream.
no setter
read List<Read>
Channel read list.
no setter
readStream Stream<List<Read>>
Channel read list as a stream.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
threads Map<String, List<Message>>
The channel threads related to this channel.
no setter
threadsStream Stream<Map<String, List<Message>>>
The channel threads related to this channel as a stream.
no setter
typingEvents Map<User, Event>
Channel related typing users last value.
no setter
typingEventsStream Stream<Map<User, Event>>
Channel related typing users stream.
no setter
unreadCount int
Unread count getter.
getter/setter pair
unreadCountStream Stream<int>
Unread count getter as a stream.
no setter
watcherCount int?
Channel watcher count.
no setter
watcherCountStream Stream<int?>
Channel watcher count as a stream.
no setter
watchers List<User>
Channel watchers list.
no setter
watchersStream Stream<List<User>>
Channel watchers list as a stream.
no setter

Methods

cleanUpStaleErrorMessages() → void
Cleans up all the stale error messages which requires no action.
clearThread(String parentId) → void
Clears all the replies in the thread identified by parentId.
countUnreadMentions() int
Counts the number of unread messages mentioning the current user.
deleteDraft(Draft draft) → void
Deletes the draft from the state if it exists.
deleteMessage(Message message, {bool hardDelete = false}) → void
Removes/Updates the message based on the hardDelete value.
deleteReminder(MessageReminder reminder) → void
Deletes the reminder of the message if it exists.
deliveriesOf({required Message message}) List<Read>

Available on ChannelClientState, provided by the ChannelReadHelper extension

Returns the list of Reads that have marked the given message as delivered.
deliveriesOfStream({required Message message}) Stream<List<Read>>

Available on ChannelClientState, provided by the ChannelReadHelper extension

Stream of list of Reads that have marked the given message as delivered.
dispose() → void
Call this method to dispose this object.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
readsOf({required Message message}) List<Read>

Available on ChannelClientState, provided by the ChannelReadHelper extension

Returns the list of Reads that have marked the given msg as read.
readsOfStream({required Message message}) Stream<List<Read>>

Available on ChannelClientState, provided by the ChannelReadHelper extension

Stream of list of Reads that have marked the given msg as read.
removeMessage(Message message) → void
Remove a message from this channelState.
retryFailedMessages() Future<void>
Retry failed message.
threadDraft(String parentId) Draft?
Draft for a specific thread identified by parentId.
threadDraftStream(String parentId) Stream<Draft?>
Stream of draft for a specific thread identified by parentId.
toString() String
A string representation of this object.
inherited
truncate() → void
Delete all channel messages.
updateChannelState(ChannelState updatedState) → void
Update channelState with updated information.
updateDraft(Draft draft) → void
Updates the draft in the channel state or the message if it exists.
updateMessage(Message message) → void
Updates the message in the state if it exists. Adds it otherwise.
updateRead([Iterable<Read>? read]) → void
Updates the read in the state if it exists. Adds it otherwise.
updateReminder(MessageReminder reminder) → void
Updates the reminder of the message if it exists.
updateThreadInfo(String parentId, List<Message> messages) → void
Update threads with updated information about messages.
userReadOf({String? userId}) Read?

Available on ChannelClientState, provided by the ChannelReadHelper extension

Get the Read object for a specific user identified by userId.
userReadStreamOf({String? userId}) Stream<Read?>

Available on ChannelClientState, provided by the ChannelReadHelper extension

Stream of Read object for a specific user identified by userId.

Operators

operator ==(Object other) bool
The equality operator.
inherited