InlineQueryResultPhoto.fromJson constructor
Constructs an InlineQueryResultPhoto object from a JSON object
Implementation
factory InlineQueryResultPhoto.fromJson(Map<String, dynamic> json) {
return InlineQueryResultPhoto(
photoUrl: json['photo_url'] as String,
thumbnailUrl: json['thumbnail_url'] as String,
id: json['id'] as String,
photoWidth: json['photo_width'] as int?,
photoHeight: json['photo_height'] as int?,
title: json['title'] as String?,
description: json['description'] as String?,
caption: json['caption'] as String?,
parseMode: json['parse_mode'] == null
? null
: ParseMode.fromJson(json['parse_mode'] as String),
captionEntities: (json['caption_entities'] as List<dynamic>?)
?.map((e) => MessageEntity.fromJson(e as Map<String, dynamic>))
.toList(),
replyMarkup: json['reply_markup'] == null
? null
: InlineKeyboardMarkup.fromJson(
json['reply_markup'] as Map<String, dynamic>,
),
inputMessageContent: json['input_message_content'] == null
? null
: InputMessageContent.fromJson(
json['input_message_content'] as Map<String, dynamic>,
),
showCaptionAboveMedia: json['show_caption_above_media'],
);
}