DraftMessage class

The class that contains the information about a draft message.

Available extensions
Annotations
  • @JsonSerializable(includeIfNull: false)

Constructors

DraftMessage.new({String? id, String? text, String type = MessageType.regular, List<Attachment> attachments = const [], String? parentId, bool? showInChannel, List<User> mentionedUsers = const [], Message? quotedMessage, String? quotedMessageId, bool silent = false, String? command, Poll? poll, String? pollId, Map<String, Object?> extraData = const {}})
Creates a new draft message.
DraftMessage.fromJson(Map<String, dynamic> json)
Create a new instance from JSON.
factory

Properties

attachments List<Attachment>
The list of attachments, either provided by the user or generated from a command or as a result of URL scraping.
final
command String?
Optional command associated with the message.
final
extraData Map<String, Object?>
Message custom extraData.
final
hashCode int
The hash code for this object.
no setterinherited
id String
The message ID. This is either created by Stream or set client side when the message is added.
final
mentionedUsers List<User>
The list of user mentioned in the message.
final
parentId String?
The ID of the parent message, if the message is a thread reply.
final
poll Poll?
The poll associated with the message.
final
pollId String?
The ID of the poll, if a poll is associated with the message.
no setter
props List<Object?>
The list of properties that will be used to determine whether two instances are equal.
no setter
quotedMessage Message?
A quoted reply message.
final
quotedMessageId String?
The ID of the quoted message, if the message is a quoted reply.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showInChannel bool?
Check if this message needs to show in the channel.
final
silent bool
If true the message is silent.
final
stringify bool?
If set to true, the toString method will be overridden to output this instance's props.
no setterinherited
text String?
The text of this message.
final
type MessageType
The message type.
final

Methods

copyWith({String? id, String? text, MessageType? type, List<Attachment>? attachments, String? parentId, bool? showInChannel, List<User>? mentionedUsers, Message? quotedMessage, String? quotedMessageId, bool? silent, String? command, Poll? poll, String? pollId, Map<String, Object?>? extraData}) DraftMessage
Create a copy of this message with the provided values.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Serialize to json.
toMessage() Message

Available on DraftMessage, provided by the DraftMessageToMessage extension

Converts this DraftMessage to a Message.
toString() String
A string representation of this object.
inherited

Operators

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

Constants

topLevelFields → const List<String>
Known top level fields.