MessageEntity class

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

Constructors

MessageEntity({required String type, required int offset, required int length, String? url, User? user, String? language, String? customEmojiId})
Basic constructor

Properties

customEmojiId ↔ String?
Optional. For “custom_emoji” only, unique identifier of the custom emoji. Use getCustomEmojiStickers to get full information about the sticker
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
language ↔ String?
Optional. For “pre” only, the programming language of the entity text
getter/setter pair
length ↔ int
Length of the entity in UTF-16 code units
getter/setter pair
offset ↔ int
Offset in UTF-16 code units to the start of the entity
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
type ↔ String
Type of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag), “cashtag” ($USD), “bot_command” (/start@jobs_bot), “url” (https://telegram.org), “email” (do-not-reply@telegram.org), “phone_number” (+1-212-555-0123), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames), “custom_emoji” (for inline custom emoji stickers)
getter/setter pair
url ↔ String?
Optional. For “text_link” only, URL that will be opened after user taps on the text
getter/setter pair
user ↔ User?
Optional. For “text_mention” only, the mentioned user
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map
Creates a json from the object
toString() → String
A string representation of this object.
override

Operators

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

Static Methods

fromJson(Map<String, dynamic> json) → MessageEntity
Creates a object from a json
listFromJsonArray(List json) → List<MessageEntity>
Creates a list of object from a json array