Channel class

This a the class that manages a specific channel.


Channel(Client _client, String type, String _id, Map<String, dynamic> _extraData)
Create a channel client instance.
Channel.fromState(Client _client, ChannelState channelState)
Create a channel client instance from a ChannelState object


cid String
Channel cid
cidStream Stream<String>
Channel cid as a stream
client Client
The main Stream chat client
config ChannelConfig
Channel configuration
configStream Stream<ChannelConfig>
Channel configuration as a stream
createdAt DateTime
Channel creation date
createdAtStream Stream<DateTime>
Channel creation date as a stream
createdBy User
Channel user creator
createdByStream Stream<User>
Channel user creator as a stream
deletedAt DateTime
Channel deletion date
deletedAtStream Stream<DateTime>
Channel deletion date as a stream
extraData Map<String, dynamic>
Channel extra data
extraDataStream Stream<Map<String, dynamic>>
Channel extra data as a stream
frozen bool
Channel frozen status
frozenStream Stream<bool>
Channel frozen status as a stream
hashCode int
The hash code for this object. [...]
read-only, inherited
id String
Channel id
idStream Stream<String>
Channel id as a stream
initialized Future<bool>
True if this is initialized Call watch to initialize the client or instantiate it using Channel.fromState
isMuted bool
Returns true if the channel is muted
lastMessageAt DateTime
Channel last message date
lastMessageAtStream Stream<DateTime>
Channel last message date as a stream
memberCount int
Channel member count
memberCountStream Stream<int>
Channel member count as a stream
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
state ChannelClientState
This client state
read / write
type String
The channel type
read / write
updatedAt DateTime
Channel updated date
updatedAtStream Stream<DateTime>
Channel updated date as a stream


acceptInvite([Message message]) Future<AcceptInviteResponse>
Accept invitation to the channel
addMembers(List<Member> members, Message message) Future<AddMembersResponse>
Add members to the channel
banUser(String userID, Map<String, dynamic> options) Future<EmptyResponse>
Bans a user from the channel
create() Future<ChannelState>
Creates a new channel
delete() Future<EmptyResponse>
Delete this channel. Messages are permanently removed.
deleteFile(String url) Future<EmptyResponse>
Delete a file from this channel
deleteImage(String url) Future<EmptyResponse>
Delete an image from this channel
deleteReaction(Message message, Reaction reaction) Future<EmptyResponse>
Delete a reaction from this channel
dispose() → void
Call this method to dispose the channel client
getMessagesById(List<String> messageIDs) Future<GetMessagesByIdResponse>
Retrieves a list of messages by ID
getReactions(String messageID, PaginationParams options) Future<QueryReactionsResponse>
List the reactions for a message in the channel
getReplies(String parentId, PaginationParams options) Future<QueryRepliesResponse>
List the message replies for a parent message
hide({bool clearHistory: false}) Future<EmptyResponse>
Hides the channel from Client.queryChannels for the user until a message is added If clearHistory is set to true - all messages will be removed for the user
inviteMembers(List<Member> members, Message message) Future<InviteMembersResponse>
Invite members to the channel
keyStroke() Future<void>
First of the EventType.typingStart and EventType.typingStop events based on the users keystrokes. Call this on every keystroke.
markRead() Future<EmptyResponse>
Mark all channel messages as read
mute({Duration expiration}) Future<EmptyResponse>
Mutes the channel
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
on([String eventType, String eventType2, String eventType3, String eventType4]) Stream<Event>
Stream of Event coming from websocket connection specific for the channel Pass an eventType as parameter in order to filter just a type of event
query({Map<String, dynamic> options: const {}, PaginationParams messagesPagination, PaginationParams membersPagination, PaginationParams watchersPagination}) Future<ChannelState>
Query the API, get messages, members or other channel fields
queryMembers({Map<String, dynamic> filter, List<SortOption> sort, PaginationParams pagination}) Future<QueryMembersResponse>
Query channel members
rejectInvite([Message message]) Future<RejectInviteResponse>
Reject invitation to the channel
removeMembers(List<Member> members, Message message) Future<RemoveMembersResponse>
Remove members from the channel
sendAction(Message message, Map<String, dynamic> formData) Future<SendActionResponse>
Send action for a specific message of this channel
sendEvent(Event event) Future<EmptyResponse>
Send an event on this channel
sendFile(MultipartFile file) Future<SendFileResponse>
Send a file to this channel
sendImage(MultipartFile file) Future<SendImageResponse>
Send an image to this channel
sendMessage(Message message) Future<SendMessageResponse>
Send a message to this channel
sendReaction(Message message, String type, {Map<String, dynamic> extraData: const {}}) Future<SendReactionResponse>
Send a reaction to this channel
show() Future<EmptyResponse>
Removes the hidden status for the channel
stopTyping() Future<void>
Sets last typing to null and sends the typing.stop event
stopWatching() Future<EmptyResponse>
Stop watching the channel
toString() String
Returns a string representation of this object.
translateMessage(String messageId, String language) Future<TranslateMessageResponse>
Retrieves a list of messages by ID
truncate() Future<EmptyResponse>
Removes all messages from the channel
unbanUser(String userID) Future<EmptyResponse>
Remove the ban for a user in the channel
unmute() Future<EmptyResponse>
Unmutes the channel
update(Map<String, dynamic> channelData, Message updateMessage) Future<UpdateChannelResponse>
Edit the channel custom data
watch([Map<String, dynamic> options = const {}]) Future<ChannelState>
Loads the initial channel state and watches for changes


operator ==(dynamic other) bool
The equality operator. [...]