map<TResult extends Object?> method

TResult map<TResult extends Object?>({
  1. required TResult animation(
    1. InlineQueryResultAnimation value
    ),
  2. required TResult article(
    1. InlineQueryResultArticle value
    ),
  3. required TResult audio(
    1. InlineQueryResultAudio value
    ),
  4. required TResult contact(
    1. InlineQueryResultContact value
    ),
  5. required TResult document(
    1. InlineQueryResultDocument value
    ),
  6. required TResult game(
    1. InlineQueryResultGame value
    ),
  7. required TResult location(
    1. InlineQueryResultLocation value
    ),
  8. required TResult photo(
    1. InlineQueryResultPhoto value
    ),
  9. required TResult sticker(
    1. InlineQueryResultSticker value
    ),
  10. required TResult venue(
    1. InlineQueryResultVenue value
    ),
  11. required TResult video(
    1. InlineQueryResultVideo value
    ),
  12. required TResult voiceNote(
    1. InlineQueryResultVoiceNote value
    ),
})

Implementation

TResult map<TResult extends Object?>({
  required TResult Function(InlineQueryResultAnimation value) animation,
  required TResult Function(InlineQueryResultArticle value) article,
  required TResult Function(InlineQueryResultAudio value) audio,
  required TResult Function(InlineQueryResultContact value) contact,
  required TResult Function(InlineQueryResultDocument value) document,
  required TResult Function(InlineQueryResultGame value) game,
  required TResult Function(InlineQueryResultLocation value) location,
  required TResult Function(InlineQueryResultPhoto value) photo,
  required TResult Function(InlineQueryResultSticker value) sticker,
  required TResult Function(InlineQueryResultVenue value) venue,
  required TResult Function(InlineQueryResultVideo value) video,
  required TResult Function(InlineQueryResultVoiceNote value) voiceNote,
}) {
  switch (getConstructor()) {
    case InlineQueryResultAnimation.constructor:
      return animation.call(this as InlineQueryResultAnimation);
    case InlineQueryResultArticle.constructor:
      return article.call(this as InlineQueryResultArticle);
    case InlineQueryResultAudio.constructor:
      return audio.call(this as InlineQueryResultAudio);
    case InlineQueryResultContact.constructor:
      return contact.call(this as InlineQueryResultContact);
    case InlineQueryResultDocument.constructor:
      return document.call(this as InlineQueryResultDocument);
    case InlineQueryResultGame.constructor:
      return game.call(this as InlineQueryResultGame);
    case InlineQueryResultLocation.constructor:
      return location.call(this as InlineQueryResultLocation);
    case InlineQueryResultPhoto.constructor:
      return photo.call(this as InlineQueryResultPhoto);
    case InlineQueryResultSticker.constructor:
      return sticker.call(this as InlineQueryResultSticker);
    case InlineQueryResultVenue.constructor:
      return venue.call(this as InlineQueryResultVenue);
    case InlineQueryResultVideo.constructor:
      return video.call(this as InlineQueryResultVideo);
    case InlineQueryResultVoiceNote.constructor:
      return voiceNote.call(this as InlineQueryResultVoiceNote);
  }
  throw StateError('not handled type Generator');
}