fromMap static method

InputInlineQueryResultPhoto? fromMap(
  1. Map<String, dynamic>? _map
)
override

Construct from Map.

Implementation

static InputInlineQueryResultPhoto? fromMap(Map<String, dynamic>? _map) {
  if (_map == null) return null;
  var _ = _map["@type"];
  if (_ != CONSTRUCTOR) return null;
  var extra = _map['@extra'];
  var clientId = _map['@clientId'];
  var id = _map['id']! as String;
  var title = _map['title']! as String;
  var description = _map['description']! as String;
  var thumbnail_url = _map['thumbnail_url']! as String;
  var photo_url = _map['photo_url']! as String;
  var photo_width = _map['photo_width']! as int;
  var photo_height = _map['photo_height']! as int;
  var reply_markup = ReplyMarkup.fromMap(_map['reply_markup']);
  var input_message_content =
      InputMessageContent.fromMap(_map['input_message_content'])!;
  return InputInlineQueryResultPhoto(
    extra: extra,
    clientId: clientId,
    id: id,
    title: title,
    description: description,
    thumbnail_url: thumbnail_url,
    photo_url: photo_url,
    photo_width: photo_width,
    photo_height: photo_height,
    reply_markup: reply_markup,
    input_message_content: input_message_content,
  );
}