MessageEntity class abstract

This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc.

Available extensions
Annotations
  • @freezed

Constructors

MessageEntity({@JsonKey.new(name: 'type') required MessageEntityType type, @JsonKey.new(name: 'offset') required int offset, @JsonKey.new(name: 'length') required int length, @JsonKey.new(name: 'url') String? url, @JsonKey.new(name: 'user') User? user, @JsonKey.new(name: 'language') String? language, @JsonKey.new(name: 'custom_emoji_id') String? customEmojiId, @JsonKey.new(name: 'unix_time') int? unixTime, @JsonKey.new(name: 'date_time_format') String? dateTimeFormat})
Constructs the MessageEntity object
const
factory
MessageEntity.fromJson(Map<String, dynamic> json)
Converts a JSON object to a MessageEntity
factory

Properties

copyWith → $MessageEntityCopyWith<MessageEntity>
Create a copy of MessageEntity with the given fields replaced by the non-null parameter values.
no setterinherited
customEmojiId → String?
Optional. For "custom_emoji" only, unique identifier of the custom emoji. Use getCustomEmojiStickers to get full information about the sticker
no setterinherited
dateTimeFormat → String?
Optional. For “date_time” only, the string that defines the formatting of the date and time. See date-time entity formatting for more details.
no setterinherited
hashCode → int
The hash code for this object.
no setterinherited
language → String?
Optional. For "pre" only, the programming language of the entity text
no setterinherited
length → int
Length of the entity in UTF-16 code units
no setterinherited
offset → int
Offset in UTF-16 code units to the start of the entity
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
type → MessageEntityType
Type of the entity. Currently, can be:
no setterinherited
unixTime → int?
Optional. For “date_time” only, the Unix time associated with the entity
no setterinherited
url → String?
Optional. For "text_link" only, URL that will be opened after user taps on the text
no setterinherited
user → User?
Optional. For "text_mention" only, the mentioned user
no setterinherited

Methods

map<TResult extends Object?>(TResult $default(_MessageEntity value)) → TResult

Available on MessageEntity, provided by the MessageEntityPatterns extension

A switch-like method, using callbacks.
mapOrNull<TResult extends Object?>(TResult? $default(_MessageEntity value)?) → TResult?

Available on MessageEntity, provided by the MessageEntityPatterns extension

A variant of map that fallback to returning null.
maybeMap<TResult extends Object?>(TResult $default(_MessageEntity value)?, {required TResult orElse()}) → TResult

Available on MessageEntity, provided by the MessageEntityPatterns extension

A variant of map that fallback to returning orElse.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
Serializes this MessageEntity to a JSON map.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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