MessageEntity class abstract
This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc.
- Annotations
-
- @freezed
Constructors
- MessageEntity.new({@JsonKey(name: 'type') required MessageEntityType type, @JsonKey(name: 'offset') required int offset, @JsonKey(name: 'length') required int length, @JsonKey(name: 'url') String? url, @JsonKey(name: 'user') User? user, @JsonKey(name: 'language') String? language, @JsonKey(name: 'custom_emoji_id') String? customEmojiId})
-
Constructs the
MessageEntity
objectconstfactory -
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
- 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
- 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
-
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