BaseChannel class

Represents base channel

This class contains properties and methods for both GroupChannel and OpenChannel. Note that this is base class for two offical types - group and open - so you won't have any given channel that only derives from this class.

Implemented types
Implementers
Available extensions

Constructors

BaseChannel.new({required String channelUrl, User? creator, int? createdAt, String? name, String? coverUrl, String? data, String? customType, bool isFrozen = false, bool isEphemeral = false, bool fromCache = false, bool dirty = false})
WARNING: Do not use default constructor to initialize manually

Properties

channelType ChannelType
Channel type for this channel
no setter
channelUrl String
This channel url
getter/setter pair
coverUrl String?
cover image URL for this channel
getter/setter pair
createdAt int?
timestamp when this channel is created
getter/setter pair
creator User?
User who creates this channel
getter/setter pair
customType String?
custom type for this channel
getter/setter pair
data String?
custom data for this channel
getter/setter pair
dirty bool
getter/setter pairoverride
fromCache bool
local usage
getter/setter pair
hashCode int
The hash code for this object.
no setteroverride
isEphemeral bool
True if this channel is ephemeral
getter/setter pair
isFrozen bool
Ture if this channel is frozen
getter/setter pair
key String
no setteroverride
name String?
name for this channel
getter/setter pair
primaryKey String
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addMessageMetaArray(BaseMessage message, List<MessageMetaArray> metaArrays) Future<BaseMessage>

Available on BaseChannel, provided by the Meta extension

Adds list of metaArrays with given message.
addOperators(List<String> userIds) Future<void>

Available on BaseChannel, provided by the BaseChannelConfiguration extension

Adds operators on this channel with given userIds.
addPollOption({required int pollId, required String optionText, OnPollCallback? onCompleted}) Future<Poll>

Available on BaseChannel, provided by the Messages extension

Add Poll Option
addReaction(BaseMessage message, String key) Future<ReactionEvent>

Available on BaseChannel, provided by the Reactions extension

Adds reaction key to given message
banUser({required String userId, int seconds = -1, String? description}) Future<void>

Available on BaseChannel, provided by the Moderations extension

Bans a user from this channel.
cancelScheduledMessage(int scheduledMessageId, {OnScheduledMessageCancelCallback? callback}) Future<void>

Available on BaseChannel, provided by the Messages extension

Cancels scheduled message
cancelUploadingFileMessage(String requestId) bool

Available on BaseChannel, provided by the Messages extension

closePoll({required int pollId, OnPollCallback? onCompleted}) Future<Poll>

Available on BaseChannel, provided by the Messages extension

Close Poll
copyMessage(BaseMessage message, BaseChannel targetChannel, {OnMessageCallback? onCompleted}) BaseMessage

Available on BaseChannel, provided by the Messages extension

Copies message to targetChannel.
copyWith(dynamic others) → void
override
createMetaCounters(Map<String, int> metaCounters) Future<Map<String, int>>

Available on BaseChannel, provided by the Meta extension

Creates meta counters on this channel with metaCounters.
createMetaData(Map<String, String> metaData) Future<Map<String, String>>

Available on BaseChannel, provided by the Meta extension

Creates meta data on this channel with metaData.
createScheduledFileMessage(ScheduledFileMessageParams fileMessageParams, {OnScheduledMessageCallback<ScheduledFileMessage>? callback}) Future<ScheduledFileMessage>

Available on BaseChannel, provided by the Messages extension

Creates scheduled file message
createScheduledUserMessage(ScheduledUserMessageParams userMessageParams, {OnScheduledMessageCallback<ScheduledUserMessage>? callback}) Future<ScheduledUserMessage>

Available on BaseChannel, provided by the Messages extension

Creates scheduled user message
decreaseMetaCounters(Map<String, int> metaCounters) Future<Map<String, int>>

Available on BaseChannel, provided by the Meta extension

Decreases meta counters on this channel with metaCounters.
deleteAllMetaCounters() Future<void>

Available on BaseChannel, provided by the Meta extension

Deletes all meta counters
deleteAllMetaData() Future<void>

Available on BaseChannel, provided by the Meta extension

Deletes a meta data on this channel with key.
deleteMessage(int messageId) Future<void>

Available on BaseChannel, provided by the Messages extension

Deletes message with given messageId.
deleteMessageMetaArrayKeys(BaseMessage message, List<String> keys) Future<BaseMessage>

Available on BaseChannel, provided by the Meta extension

Deletes keys from MessageMetaArray given message.
deleteMetaCounters(String key) Future<void>

Available on BaseChannel, provided by the Meta extension

Deletes a meta counter with given key
deleteMetaData(String key) Future<void>

Available on BaseChannel, provided by the Meta extension

Deletes a meta data on this channel with key.
deletePoll({required int pollId, OnCompleteCallback? onCompleted}) Future<void>

Available on BaseChannel, provided by the Messages extension

Delete Poll
deletePollOption({required int pollId, required int pollOptionId, OnCompleteCallback? onCompleted}) Future<void>

Available on BaseChannel, provided by the Messages extension

Delete Poll Option
deleteReaction(BaseMessage message, String key) Future<ReactionEvent>

Available on BaseChannel, provided by the Reactions extension

Deletes reaction key from message
getAllMetaCounters() Future<Map<String, int>>

Available on BaseChannel, provided by the Meta extension

Retrieves all meta counters from this channel.
getAllMetaData() Future<Map<String, String>>

Available on BaseChannel, provided by the Meta extension

Retrieves all metaData from this channel.
getCachedMetaData() Map<String, String>

Available on BaseChannel, provided by the Meta extension

Returns cached meta data
getMessageChangeLogs({int? timestamp, String? token, required MessageChangeLogParams params}) Future<MessageChangeLogsResponse>

Available on BaseChannel, provided by the Messages extension

Retreieve massage change logs with timestamp or token and params.
getMessagesById(int messageId, MessageListParams params) Future<List<BaseMessage>>

Available on BaseChannel, provided by the Messages extension

Retrieves a list of BaseMessage with given messageId and params.
getMessagesByTimestamp(int timestamp, MessageListParams params) Future<List<BaseMessage>>

Available on BaseChannel, provided by the Messages extension

Retrieves a list of BaseMessage with given timestamp and params.
getMetaCounters(List<String> keys) Future<Map<String, int>>

Available on BaseChannel, provided by the Meta extension

Retrieves meta counters from this channel with keys.
getMetaData(List<String> keys) Future<Map<String, String>>

Available on BaseChannel, provided by the Meta extension

Retrieves meta data from this channel with keys.
getMyMuteInfo() Future<MuteInfoResponse>

Available on BaseChannel, provided by the Moderations extension

Gets current user's mute information
increaseMetaCounters(Map<String, int> metaCounters) Future<Map<String, int>>

Available on BaseChannel, provided by the Meta extension

Increases meta counters on this channel with metaCounters.
muteUser({required String userId, int seconds = -1, String? description}) Future<void>

Available on BaseChannel, provided by the Moderations extension

Mutes a user from this channel.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeAllOperators() Future<void>

Available on BaseChannel, provided by the BaseChannelConfiguration extension

Removes all operators on this channel.
removeFromCache() → void

Available on Cacheable, provided by the Operation extension

removeMessageMetaArray(BaseMessage message, List<MessageMetaArray> metaArrays) Future<BaseMessage>

Available on BaseChannel, provided by the Meta extension

Removes values from list of metaArrays with given message
removeOperators(List<String> userIds) Future<void>

Available on BaseChannel, provided by the BaseChannelConfiguration extension

Removes operators on this channel with given userIds.
reportChannel({required ReportCategory category, String? description}) Future<void>

Available on BaseChannel, provided by the Moderations extension

Reports this channel with category and description (optional)
reportMessage({required BaseMessage message, required ReportCategory category, String? description}) Future<void>

Available on BaseChannel, provided by the Moderations extension

Reports message with category and description (optional)
reportUser({required String userId, required ReportCategory category, String? description}) Future<void>

Available on BaseChannel, provided by the Moderations extension

Reports a User with category and description (optional)
resendFileMessage(FileMessage message, {required FileMessageParams params, OnFileMessageCallback? onCompleted, OnUploadProgressCallback? progress}) FileMessage

Available on BaseChannel, provided by the Messages extension

Resends failed FileMessage on this channel with message.
resendUserMessage(UserMessage message, {OnUserMessageCallback? onCompleted}) UserMessage

Available on BaseChannel, provided by the Messages extension

Resends failed UserMessage on this channel with message.
saveToCache() → void

Available on Cacheable, provided by the Operation extension

sendFileMessage(FileMessageParams params, {OnFileMessageCallback? onCompleted, OnUploadProgressCallback? progress}) FileMessage

Available on BaseChannel, provided by the Messages extension

Sends FileMessage on this channel with params.
sendScheduledMessageNow({required int scheduledMessageId, OnScheduledMessageSendNowCallback? callback}) Future<void>

Available on BaseChannel, provided by the Messages extension

Sends Scheduled Message Now
sendUserMessage(UserMessageParams params, {OnUserMessageCallback? onCompleted}) UserMessage

Available on BaseChannel, provided by the Messages extension

Sends UserMessage on this channel with params.
sendUserMessageWithText(String text, {OnUserMessageCallback? onCompleted}) UserMessage

Available on BaseChannel, provided by the Messages extension

Sends UserMessage on this channel with text.
toString() String
A string representation of this object.
inherited
translateUserMessage(UserMessage message, List<String> targetLanguages) Future<UserMessage>

Available on BaseChannel, provided by the Messages extension

Translates a message with given list of targetLanguages.
unbanUser({required String userId}) Future<void>

Available on BaseChannel, provided by the Moderations extension

Unbans a user from this channel
unmuteUser({required String userId}) Future<void>

Available on BaseChannel, provided by the Moderations extension

Unmutes user from this channel.
updateFileMessage(int messageId, FileMessageParams params) Future<FileMessage>

Available on BaseChannel, provided by the Messages extension

Updates FileMessage on this channel with messageId and params.
updateMetaCounters(Map<String, int> metaCounters) Future<Map<String, int>>

Available on BaseChannel, provided by the Meta extension

Updates meta counters on this channel with metaCounters.
updateMetaData(Map<String, String> metaData) Future<Map<String, String>>

Available on BaseChannel, provided by the Meta extension

Updates meta data on this channel with metaData.
updatePoll({required int pollId, required PollUpdateParams params, OnPollCallback? onCompleted}) Future<Poll>

Available on BaseChannel, provided by the Messages extension

Updates Poll
updatePollOption({required int pollId, required int pollOptionId, required String optionText, OnPollCallback? onCompleted}) Future<Poll>

Available on BaseChannel, provided by the Messages extension

Update Poll Option
updateScheduledFileMessage({required ScheduledFileMessageUpdateParams params, required int scheduledMessageid, OnScheduledMessageCallback<ScheduledFileMessage>? callback}) Future<ScheduledFileMessage>

Available on BaseChannel, provided by the Messages extension

Update scheduled file message
updateScheduledUserMessage({required ScheduledUserMessageUpdateParams params, required int scheduledMessageid, OnScheduledMessageCallback<ScheduledUserMessage>? callback}) Future<ScheduledUserMessage>

Available on BaseChannel, provided by the Messages extension

Update scheduled user message
updateUserMessage(int messageId, UserMessageParams params) Future<UserMessage>

Available on BaseChannel, provided by the Messages extension

Updates UserMessage on this channel with messageId and params.
votePoll({required int pollId, required List<int> pollOptionIds, OnPollVoteEventCallback? onCompleted}) Future<PollVoteEvent>

Available on BaseChannel, provided by the Messages extension

Cast/ Cancel Poll Vote

Operators

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

Static Methods

getBaseChannel(ChannelType type, String channelUrl) Future<BaseChannel>
Returns channel with given type and channelUrl
refreshChannel(ChannelType channelType, String channelUrl) Future<BaseChannel>
Refreshes this channel instance