InlineQueryResult.fromJson constructor

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

Implementation

factory InlineQueryResult.fromJson(Map<String, dynamic> json)  {
  switch(json["@type"]) {
    case InlineQueryResultArticle.CONSTRUCTOR:
      return InlineQueryResultArticle.fromJson(json);
    case InlineQueryResultContact.CONSTRUCTOR:
      return InlineQueryResultContact.fromJson(json);
    case InlineQueryResultLocation.CONSTRUCTOR:
      return InlineQueryResultLocation.fromJson(json);
    case InlineQueryResultVenue.CONSTRUCTOR:
      return InlineQueryResultVenue.fromJson(json);
    case InlineQueryResultGame.CONSTRUCTOR:
      return InlineQueryResultGame.fromJson(json);
    case InlineQueryResultAnimation.CONSTRUCTOR:
      return InlineQueryResultAnimation.fromJson(json);
    case InlineQueryResultAudio.CONSTRUCTOR:
      return InlineQueryResultAudio.fromJson(json);
    case InlineQueryResultDocument.CONSTRUCTOR:
      return InlineQueryResultDocument.fromJson(json);
    case InlineQueryResultPhoto.CONSTRUCTOR:
      return InlineQueryResultPhoto.fromJson(json);
    case InlineQueryResultSticker.CONSTRUCTOR:
      return InlineQueryResultSticker.fromJson(json);
    case InlineQueryResultVideo.CONSTRUCTOR:
      return InlineQueryResultVideo.fromJson(json);
    case InlineQueryResultVoiceNote.CONSTRUCTOR:
      return InlineQueryResultVoiceNote.fromJson(json);
    default:
      return const InlineQueryResult();
  }
}