fromMap static method

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

Construct from Map.

Implementation

static InputInlineQueryResultVoiceNote? 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 voice_note_url = _map['voice_note_url']! as String;
  var voice_note_duration = _map['voice_note_duration']! as int;
  var reply_markup = ReplyMarkup.fromMap(_map['reply_markup']);
  var input_message_content =
      InputMessageContent.fromMap(_map['input_message_content'])!;
  return InputInlineQueryResultVoiceNote(
    extra: extra,
    clientId: clientId,
    id: id,
    title: title,
    voice_note_url: voice_note_url,
    voice_note_duration: voice_note_duration,
    reply_markup: reply_markup,
    input_message_content: input_message_content,
  );
}