maybeMap<TResult extends Object?> method
TResult
maybeMap<TResult extends Object?>({
- TResult article(
- InlineQueryResultArticle value
- TResult contact(
- InlineQueryResultContact value
- TResult location()?,
- TResult venue(
- InlineQueryResultVenue value
- TResult game(
- InlineQueryResultGame value
- TResult animation()?,
- TResult audio(
- InlineQueryResultAudio value
- TResult document()?,
- TResult photo(
- InlineQueryResultPhoto value
- TResult sticker(
- InlineQueryResultSticker value
- TResult video(
- InlineQueryResultVideo value
- TResult voiceNote()?,
- required TResult orElse(),
Implementation
TResult maybeMap<TResult extends Object?>({
TResult Function(InlineQueryResultArticle value)? article,
TResult Function(InlineQueryResultContact value)? contact,
TResult Function(InlineQueryResultLocation value)? location,
TResult Function(InlineQueryResultVenue value)? venue,
TResult Function(InlineQueryResultGame value)? game,
TResult Function(InlineQueryResultAnimation value)? animation,
TResult Function(InlineQueryResultAudio value)? audio,
TResult Function(InlineQueryResultDocument value)? document,
TResult Function(InlineQueryResultPhoto value)? photo,
TResult Function(InlineQueryResultSticker value)? sticker,
TResult Function(InlineQueryResultVideo value)? video,
TResult Function(InlineQueryResultVoiceNote value)? voiceNote,
required TResult Function() orElse,
}) {
switch (getConstructor()) {
case InlineQueryResultArticle.constructor:
if (article != null) {
return article.call(this as InlineQueryResultArticle);
}
break;
case InlineQueryResultContact.constructor:
if (contact != null) {
return contact.call(this as InlineQueryResultContact);
}
break;
case InlineQueryResultLocation.constructor:
if (location != null) {
return location.call(this as InlineQueryResultLocation);
}
break;
case InlineQueryResultVenue.constructor:
if (venue != null) {
return venue.call(this as InlineQueryResultVenue);
}
break;
case InlineQueryResultGame.constructor:
if (game != null) {
return game.call(this as InlineQueryResultGame);
}
break;
case InlineQueryResultAnimation.constructor:
if (animation != null) {
return animation.call(this as InlineQueryResultAnimation);
}
break;
case InlineQueryResultAudio.constructor:
if (audio != null) {
return audio.call(this as InlineQueryResultAudio);
}
break;
case InlineQueryResultDocument.constructor:
if (document != null) {
return document.call(this as InlineQueryResultDocument);
}
break;
case InlineQueryResultPhoto.constructor:
if (photo != null) {
return photo.call(this as InlineQueryResultPhoto);
}
break;
case InlineQueryResultSticker.constructor:
if (sticker != null) {
return sticker.call(this as InlineQueryResultSticker);
}
break;
case InlineQueryResultVideo.constructor:
if (video != null) {
return video.call(this as InlineQueryResultVideo);
}
break;
case InlineQueryResultVoiceNote.constructor:
if (voiceNote != null) {
return voiceNote.call(this as InlineQueryResultVoiceNote);
}
break;
}
return orElse.call();
}