fromMap static method

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

Construct from Map.

Implementation

static InlineQueryResult? fromMap(Map<String, dynamic>? _map) {
  if (_map == null) return null;
  var _ = _map["@type"];
  switch (_) {
    case 'inlineQueryResultAudio':
      return InlineQueryResultAudio.fromMap(_map);
    case 'inlineQueryResultVenue':
      return InlineQueryResultVenue.fromMap(_map);
    case 'inlineQueryResultPhoto':
      return InlineQueryResultPhoto.fromMap(_map);
    case 'inlineQueryResultVideo':
      return InlineQueryResultVideo.fromMap(_map);
    case 'inlineQueryResultSticker':
      return InlineQueryResultSticker.fromMap(_map);
    case 'inlineQueryResultContact':
      return InlineQueryResultContact.fromMap(_map);
    case 'inlineQueryResultGame':
      return InlineQueryResultGame.fromMap(_map);
    case 'inlineQueryResultDocument':
      return InlineQueryResultDocument.fromMap(_map);
    case 'inlineQueryResultVoiceNote':
      return InlineQueryResultVoiceNote.fromMap(_map);
    case 'inlineQueryResultAnimation':
      return InlineQueryResultAnimation.fromMap(_map);
    case 'inlineQueryResultArticle':
      return InlineQueryResultArticle.fromMap(_map);
    case 'inlineQueryResultLocation':
      return InlineQueryResultLocation.fromMap(_map);
    case null:
    default:
      return null;
  }
}