TextEntityType.fromJson constructor
a TextEntityType return type can be :
- TextEntityTypeMention
- TextEntityTypeHashtag
- TextEntityTypeCashtag
- TextEntityTypeBotCommand
- TextEntityTypeUrl
- TextEntityTypeEmailAddress
- TextEntityTypePhoneNumber
- TextEntityTypeBankCardNumber
- TextEntityTypeBold
- TextEntityTypeItalic
- TextEntityTypeUnderline
- TextEntityTypeStrikethrough
- TextEntityTypeSpoiler
- TextEntityTypeCode
- TextEntityTypePre
- TextEntityTypePreCode
- TextEntityTypeTextUrl
- TextEntityTypeMentionName
- TextEntityTypeCustomEmoji
- TextEntityTypeMediaTimestamp
Implementation
factory TextEntityType.fromJson(Map<String, dynamic> json) {
switch (json["@type"]) {
case TextEntityTypeMention.CONSTRUCTOR:
return TextEntityTypeMention.fromJson(json);
case TextEntityTypeHashtag.CONSTRUCTOR:
return TextEntityTypeHashtag.fromJson(json);
case TextEntityTypeCashtag.CONSTRUCTOR:
return TextEntityTypeCashtag.fromJson(json);
case TextEntityTypeBotCommand.CONSTRUCTOR:
return TextEntityTypeBotCommand.fromJson(json);
case TextEntityTypeUrl.CONSTRUCTOR:
return TextEntityTypeUrl.fromJson(json);
case TextEntityTypeEmailAddress.CONSTRUCTOR:
return TextEntityTypeEmailAddress.fromJson(json);
case TextEntityTypePhoneNumber.CONSTRUCTOR:
return TextEntityTypePhoneNumber.fromJson(json);
case TextEntityTypeBankCardNumber.CONSTRUCTOR:
return TextEntityTypeBankCardNumber.fromJson(json);
case TextEntityTypeBold.CONSTRUCTOR:
return TextEntityTypeBold.fromJson(json);
case TextEntityTypeItalic.CONSTRUCTOR:
return TextEntityTypeItalic.fromJson(json);
case TextEntityTypeUnderline.CONSTRUCTOR:
return TextEntityTypeUnderline.fromJson(json);
case TextEntityTypeStrikethrough.CONSTRUCTOR:
return TextEntityTypeStrikethrough.fromJson(json);
case TextEntityTypeSpoiler.CONSTRUCTOR:
return TextEntityTypeSpoiler.fromJson(json);
case TextEntityTypeCode.CONSTRUCTOR:
return TextEntityTypeCode.fromJson(json);
case TextEntityTypePre.CONSTRUCTOR:
return TextEntityTypePre.fromJson(json);
case TextEntityTypePreCode.CONSTRUCTOR:
return TextEntityTypePreCode.fromJson(json);
case TextEntityTypeTextUrl.CONSTRUCTOR:
return TextEntityTypeTextUrl.fromJson(json);
case TextEntityTypeMentionName.CONSTRUCTOR:
return TextEntityTypeMentionName.fromJson(json);
case TextEntityTypeCustomEmoji.CONSTRUCTOR:
return TextEntityTypeCustomEmoji.fromJson(json);
case TextEntityTypeMediaTimestamp.CONSTRUCTOR:
return TextEntityTypeMediaTimestamp.fromJson(json);
default:
return const TextEntityType();
}
}