UserMessage class

Object representing a user message.

Available Extensions


UserMessage({required Map<String, String> translations, required int messageId, required String message, required String channelUrl, required ChannelType channelType, Sender? sender, SendingStatus? sendingStatus, String? requestId, List<User> mentionedUsers = const [], MentionType? mentionType, List<String>? requestedMentionUserIds, int createdAt = 0, int updatedAt = 0, int? parentMessageId, String? parentMessageText, ThreadInfo? threadInfo, List<MessageMetaArray>? metaArrays, String? customType, int? messageSurvivalSeconds, bool forceUpdateLastMessage = false, bool isSilent = false, bool isOperatorMessage = false, String? data, OGMetaData? ogMetaData, List<Reaction>? reactions, Map<String, dynamic>? parentMessage, bool replyToChannel = false, Poll? poll, List<String>? translationTargetLanguages})
UserMessage.fromJson(Map<String, dynamic> json)
UserMessage.fromJsonWithChat(Chat chat, Map<String, dynamic> json)


allMetaArrays List<MessageMetaArray>?
All MessageMetaArrays of the message.
read / writeinherited
channelType ChannelType
The ChannelType of the channel this message belongs to.
read / writeinherited
channelUrl String
The channel URL of the channel this message belongs to.
chat ↔ Chat
read / writeinherited
createdAt int
The creation time of the message in milliseconds.
customType String?
The custom type of the message.
data String?
The custom data of the message.
read / writeinherited
errorCode int?
The error code of them message if the sendingStatus is SendingStatus.failed.
read / writeinherited
extendedMessage Map<String, dynamic>
extendedMessage is used for Sendbird UiKit. Only featured in GroupChannel
read / writeinherited
forceUpdateLastMessage bool
hashCode int
The hash code for this object.
isOperatorMessage bool
Whether the message was sent from an operator. This value is true if the sender of this message was an operator at the moment this message was sent. Note that Sender.role returns the role of the sender at the current moment (when the server response was sent). So if the sender's operator status changed after sending a message, the value of the property and the result of Sender.role might differ.
isReplyToChannel bool
Determines whether the current message is a replied message and also a message was replied to the channel.
read / writeinherited
isSilent bool
Checks whether the message is silent or not.
mentionedUsers List<User>
The mentioned users of the message.
read / writeinherited
mentionType MentionType?
The mention type. Refer to MentionType.
message String
The message text of the message.
messageId int
The ID of the message.
messageSurvivalSeconds int?
The message's survival seconds.
ogMetaData OGMetaData?
The OGMetaData of the message. ( Might be null if
parentMessage BaseMessage?
The parent message of this message. Only NonNull if this message is a reply message. It does not contain all properties of the parent message. Only contains:
read / writeinherited
parentMessageId int?
The parent message's ID if this is a reply message.
poll Poll?
The poll that belongs to this message object.
read / write
reactions List<Reaction>?
The reactions on the message.
read / writeinherited
requestId String?
The request ID of the message.
runtimeType Type
A representation of the runtime type of the object.
scheduledInfo ScheduledInfo?
The scheduled info of the message if this is a scheduled message
read / writeinherited
sender Sender?
The Sender of the message. If SendbirdChatOptions.useMemberInfoInMessage is set true and this message belongs to a GroupChannel (not a super group channel), the sender information, such as nickname and profile url, is returned as the same with the GroupChannel.members. Otherwise, the sender information will be returned as the value of the message creation time.
read / writeinherited
sendingStatus SendingStatus?
The sending status of the message.
read / writeinherited
threadInfo ThreadInfo?
The thread info of the message.
read / writeinherited
translations Map<String, String>
The translated messages (key-value map) for the language codes in key. The messages that have been sent with translation option will have this map. (refer to BaseChannelMessage.sendUserMessage)
translationTargetLanguages List<String>?
The list of target translation languages with the language codes. The messages that have been sent or scheduled with translation option will have this list. (refer to BaseChannelMessage.sendUserMessage)
updatedAt int
The updated time of the message in milliseconds.


applyReactionEvent(ReactionEvent event) bool
Applies ReactionEvent to message.
applyThreadInfoUpdateEvent(ThreadInfoUpdateEvent event) bool
Applies ThreadInfoUpdateEvent to a message.
getMetaArrays(List<String> keys) List<MessageMetaArray>
Returns MessageMetaArray list which is filtered by given metaArrayKeys.
getThreadedMessagesByTimestamp(int timestamp, ThreadedMessageListParams params) Future<ThreadedMessages>
Retrieves the threaded replies of the current message depending on the timestamp. If the current message doesn’t have replies, the result is an empty list. The result is passed to handler as list.
isResendable() bool
Whether the message is resendable.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
set(Chat chat) → void
toString() String
A string representation of this object.


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