Message class

Chat message.

Annotations
  • @freezed

Constructors

Message({@JsonKey(name: 'content') required MessageContent content, @JsonKey(name: 'push_text') String? pushText, @JsonKey(name: 'from') required String from, @JsonKey(name: 'to') required String to, @JsonKey(name: 'message_id') required String messageId, @JsonKey(name: 'created') @DateTimeConverter() required DateTime created, @JsonKey(name: 'drafted') @DateTimeConverter() DateTime? drafted, @JsonKey(name: 'gentime') required int gentime, @JsonKey(name: 'chat_type') required String chatType, @JsonKey(name: 'chat') required String chat, @JsonKey(name: 'links') MessageLink? links, @JsonKey(name: 'markup') List<MarkupEntity>? markup, @Default(false) @JsonKey(name: 'important') bool? important, @JsonKey(name: 'edited') @DateTimeConverter() DateTime? edited, @Default(false) @JsonKey(name: 'received') bool? received, @JsonKey(name: 'num_received') int? numReceived, @Default(false) @JsonKey(name: 'nopreview') bool? nopreview, @Default(false) @JsonKey(name: 'has_previews') bool? hasPreviews, @JsonKey(name: 'prev') String? prev, @Default(false) @JsonKey(name: 'is_first') bool? isFirst, @Default(false) @JsonKey(name: 'is_last') bool? isLast, @JsonKey(name: 'uploads') List<Upload>? uploads, @JsonKey(name: 'reactions') List<MessageReaction>? reactions, @JsonKey(name: 'reply_to') Message? replyTo, @JsonKey(name: 'linked_messages') List<Message>? linkedMessages, @Default(false) @JsonKey(name: 'notice') bool? notice, @Default(false) @JsonKey(name: 'silently') bool? silently, @JsonKey(name: 'editable_until') @DateTimeConverter() DateTime? editableUntil, @JsonKey(name: 'num') int? num, @Default(false) @JsonKey(name: 'is_archive') bool? isArchive, @JsonKey(name: '_debug') String? debug})
const
factory
Message.fromJson(Map<String, dynamic> json)
factory

Properties

chat String
Chat id.
no setterinherited
chatType String
Chat type.
no setterinherited
content MessageContent
Message content struct.
no setterinherited
copyWith → $MessageCopyWith<Message>
no setterinherited
created DateTime
Message creation datetime (set by server side) or sending datetime in future for draft messages.
no setterinherited
debug String?
Debug information, if any.
no setterinherited
drafted DateTime?
Creation datetime for draft messages.
no setterinherited
editableUntil DateTime?
Author can change this message until date. Can be null.
no setterinherited
edited DateTime?
ISODateTimeString of message modification or deletion.
no setterinherited
from String
Sender contact id.
no setterinherited
gentime int
Object version.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
hasPreviews bool?
Has link previews. True or null.
no setterinherited
important bool?
Importance flag.
no setterinherited
isArchive bool?
This message is archive. True or null.
no setterinherited
isFirst bool?
This message is first in this chat. True or null.
no setterinherited
isLast bool?
This message is last in this chat. True or null.
no setterinherited
linkedMessages List<Message>?
Forwarded messages. Can be null. Also contains double of ReplyTo for backward compatibility.
no setterinherited
External/internals links.
no setterinherited
markup List<MarkupEntity>?
Markup entities. Experimental.
no setterinherited
messageId String
Message uid.
no setterinherited
nopreview bool?
Disable link previews. True or null.
no setterinherited
notice bool?
Has mention (@). True or null.
no setterinherited
num int?
Index number of this message. Starts from 0. Null for deleted messages. Changes when any previous message wad deleted.
no setterinherited
numReceived int?
Unused yet.
no setterinherited
prev String?
Previous message id in this chat. Uid or null.
no setterinherited
pushText String?
Simple plaintext message representation.
no setterinherited
reactions List<MessageReaction>?
Message reactions struct. Can be null.
no setterinherited
received bool?
Message was seen by anybody in chat. True or null.
no setterinherited
replyTo Message?
Message that was replied to, if any.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
silently bool?
Message has no pushes and did not affect any counters.
no setterinherited
to String
Recipient id (group, task or contact).
no setterinherited
uploads List<Upload>?
Message uploads.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
inherited
toString() String
A string representation of this object.
inherited

Operators

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