map<TResult extends Object?> method

TResult map<TResult extends Object?>({
  1. required TResult animation(
    1. InputInlineQueryResultAnimation value
    ),
  2. required TResult article(
    1. InputInlineQueryResultArticle value
    ),
  3. required TResult audio(
    1. InputInlineQueryResultAudio value
    ),
  4. required TResult contact(
    1. InputInlineQueryResultContact value
    ),
  5. required TResult document(
    1. InputInlineQueryResultDocument value
    ),
  6. required TResult game(
    1. InputInlineQueryResultGame value
    ),
  7. required TResult location(
    1. InputInlineQueryResultLocation value
    ),
  8. required TResult photo(
    1. InputInlineQueryResultPhoto value
    ),
  9. required TResult sticker(
    1. InputInlineQueryResultSticker value
    ),
  10. required TResult venue(
    1. InputInlineQueryResultVenue value
    ),
  11. required TResult video(
    1. InputInlineQueryResultVideo value
    ),
  12. required TResult voiceNote(
    1. InputInlineQueryResultVoiceNote value
    ),
})

Implementation

TResult map<TResult extends Object?>({
  required TResult Function(InputInlineQueryResultAnimation value) animation,
  required TResult Function(InputInlineQueryResultArticle value) article,
  required TResult Function(InputInlineQueryResultAudio value) audio,
  required TResult Function(InputInlineQueryResultContact value) contact,
  required TResult Function(InputInlineQueryResultDocument value) document,
  required TResult Function(InputInlineQueryResultGame value) game,
  required TResult Function(InputInlineQueryResultLocation value) location,
  required TResult Function(InputInlineQueryResultPhoto value) photo,
  required TResult Function(InputInlineQueryResultSticker value) sticker,
  required TResult Function(InputInlineQueryResultVenue value) venue,
  required TResult Function(InputInlineQueryResultVideo value) video,
  required TResult Function(InputInlineQueryResultVoiceNote value) voiceNote,
}) {
  switch (getConstructor()) {
    case InputInlineQueryResultAnimation.constructor:
      return animation.call(this as InputInlineQueryResultAnimation);
    case InputInlineQueryResultArticle.constructor:
      return article.call(this as InputInlineQueryResultArticle);
    case InputInlineQueryResultAudio.constructor:
      return audio.call(this as InputInlineQueryResultAudio);
    case InputInlineQueryResultContact.constructor:
      return contact.call(this as InputInlineQueryResultContact);
    case InputInlineQueryResultDocument.constructor:
      return document.call(this as InputInlineQueryResultDocument);
    case InputInlineQueryResultGame.constructor:
      return game.call(this as InputInlineQueryResultGame);
    case InputInlineQueryResultLocation.constructor:
      return location.call(this as InputInlineQueryResultLocation);
    case InputInlineQueryResultPhoto.constructor:
      return photo.call(this as InputInlineQueryResultPhoto);
    case InputInlineQueryResultSticker.constructor:
      return sticker.call(this as InputInlineQueryResultSticker);
    case InputInlineQueryResultVenue.constructor:
      return venue.call(this as InputInlineQueryResultVenue);
    case InputInlineQueryResultVideo.constructor:
      return video.call(this as InputInlineQueryResultVideo);
    case InputInlineQueryResultVoiceNote.constructor:
      return voiceNote.call(this as InputInlineQueryResultVoiceNote);
  }
  throw StateError('not handled type Generator');
}