MessageEntity.fromJson constructor

MessageEntity.fromJson(
  1. Map<String, dynamic> json
)

Converts a MessageEntity object to a JSON object

Implementation

factory MessageEntity.fromJson(Map<String, dynamic> json) {
  return MessageEntity(
    type: MessageEntityType.fromJson(json['type']),
    offset: json['offset'],
    length: json['length'],
    url: json['url'],
    user: json['user'] != null ? User.fromJson(json['user']) : null,
    language: json['language'],
    customEmojiId: json['custom_emoji_id'],
  );
}