fromJson static method

InlineQueryResult? fromJson(
  1. Map<String, dynamic>? json
)

Implementation

static InlineQueryResult? fromJson(Map<String, dynamic>? json) {
  if (json == null) {
    return null;
  }

  switch (json['@type']) {
    case InlineQueryResultAnimation.constructor:
      return InlineQueryResultAnimation.fromJson(json);

    case InlineQueryResultArticle.constructor:
      return InlineQueryResultArticle.fromJson(json);

    case InlineQueryResultAudio.constructor:
      return InlineQueryResultAudio.fromJson(json);

    case InlineQueryResultContact.constructor:
      return InlineQueryResultContact.fromJson(json);

    case InlineQueryResultDocument.constructor:
      return InlineQueryResultDocument.fromJson(json);

    case InlineQueryResultGame.constructor:
      return InlineQueryResultGame.fromJson(json);

    case InlineQueryResultLocation.constructor:
      return InlineQueryResultLocation.fromJson(json);

    case InlineQueryResultPhoto.constructor:
      return InlineQueryResultPhoto.fromJson(json);

    case InlineQueryResultSticker.constructor:
      return InlineQueryResultSticker.fromJson(json);

    case InlineQueryResultVenue.constructor:
      return InlineQueryResultVenue.fromJson(json);

    case InlineQueryResultVideo.constructor:
      return InlineQueryResultVideo.fromJson(json);

    case InlineQueryResultVoiceNote.constructor:
      return InlineQueryResultVoiceNote.fromJson(json);

    default:
      return null;
  }
}