maybeMap<TResult extends Object?> method

TResult maybeMap<TResult extends Object?>({
  1. TResult mention(
    1. TextEntityTypeMention value
    )?,
  2. TResult hashtag(
    1. TextEntityTypeHashtag value
    )?,
  3. TResult cashtag(
    1. TextEntityTypeCashtag value
    )?,
  4. TResult botCommand(
    1. TextEntityTypeBotCommand value
    )?,
  5. TResult url(
    1. TextEntityTypeUrl value
    )?,
  6. TResult emailAddress(
    1. TextEntityTypeEmailAddress value
    )?,
  7. TResult phoneNumber(
    1. TextEntityTypePhoneNumber value
    )?,
  8. TResult bankCardNumber(
    1. TextEntityTypeBankCardNumber value
    )?,
  9. TResult tonAddress(
    1. TextEntityTypeTonAddress value
    )?,
  10. TResult bold(
    1. TextEntityTypeBold value
    )?,
  11. TResult italic(
    1. TextEntityTypeItalic value
    )?,
  12. TResult underline(
    1. TextEntityTypeUnderline value
    )?,
  13. TResult strikethrough(
    1. TextEntityTypeStrikethrough value
    )?,
  14. TResult spoiler(
    1. TextEntityTypeSpoiler value
    )?,
  15. TResult code(
    1. TextEntityTypeCode value
    )?,
  16. TResult pre(
    1. TextEntityTypePre value
    )?,
  17. TResult preCode(
    1. TextEntityTypePreCode value
    )?,
  18. TResult blockQuote(
    1. TextEntityTypeBlockQuote value
    )?,
  19. TResult expandableBlockQuote(
    1. TextEntityTypeExpandableBlockQuote value
    )?,
  20. TResult textUrl(
    1. TextEntityTypeTextUrl value
    )?,
  21. TResult mentionName(
    1. TextEntityTypeMentionName value
    )?,
  22. TResult customEmoji(
    1. TextEntityTypeCustomEmoji value
    )?,
  23. TResult mediaTimestamp(
    1. TextEntityTypeMediaTimestamp value
    )?,
  24. TResult dateTime(
    1. TextEntityTypeDateTime value
    )?,
  25. required TResult orElse(),
})

Implementation

TResult maybeMap<TResult extends Object?>({
  TResult Function(TextEntityTypeMention value)? mention,
  TResult Function(TextEntityTypeHashtag value)? hashtag,
  TResult Function(TextEntityTypeCashtag value)? cashtag,
  TResult Function(TextEntityTypeBotCommand value)? botCommand,
  TResult Function(TextEntityTypeUrl value)? url,
  TResult Function(TextEntityTypeEmailAddress value)? emailAddress,
  TResult Function(TextEntityTypePhoneNumber value)? phoneNumber,
  TResult Function(TextEntityTypeBankCardNumber value)? bankCardNumber,
  TResult Function(TextEntityTypeTonAddress value)? tonAddress,
  TResult Function(TextEntityTypeBold value)? bold,
  TResult Function(TextEntityTypeItalic value)? italic,
  TResult Function(TextEntityTypeUnderline value)? underline,
  TResult Function(TextEntityTypeStrikethrough value)? strikethrough,
  TResult Function(TextEntityTypeSpoiler value)? spoiler,
  TResult Function(TextEntityTypeCode value)? code,
  TResult Function(TextEntityTypePre value)? pre,
  TResult Function(TextEntityTypePreCode value)? preCode,
  TResult Function(TextEntityTypeBlockQuote value)? blockQuote,
  TResult Function(TextEntityTypeExpandableBlockQuote value)?
      expandableBlockQuote,
  TResult Function(TextEntityTypeTextUrl value)? textUrl,
  TResult Function(TextEntityTypeMentionName value)? mentionName,
  TResult Function(TextEntityTypeCustomEmoji value)? customEmoji,
  TResult Function(TextEntityTypeMediaTimestamp value)? mediaTimestamp,
  TResult Function(TextEntityTypeDateTime value)? dateTime,
  required TResult Function() orElse,
}) {
  switch (getConstructor()) {
    case TextEntityTypeMention.constructor:
      if (mention != null) {
        return mention.call(this as TextEntityTypeMention);
      }
      break;
    case TextEntityTypeHashtag.constructor:
      if (hashtag != null) {
        return hashtag.call(this as TextEntityTypeHashtag);
      }
      break;
    case TextEntityTypeCashtag.constructor:
      if (cashtag != null) {
        return cashtag.call(this as TextEntityTypeCashtag);
      }
      break;
    case TextEntityTypeBotCommand.constructor:
      if (botCommand != null) {
        return botCommand.call(this as TextEntityTypeBotCommand);
      }
      break;
    case TextEntityTypeUrl.constructor:
      if (url != null) {
        return url.call(this as TextEntityTypeUrl);
      }
      break;
    case TextEntityTypeEmailAddress.constructor:
      if (emailAddress != null) {
        return emailAddress.call(this as TextEntityTypeEmailAddress);
      }
      break;
    case TextEntityTypePhoneNumber.constructor:
      if (phoneNumber != null) {
        return phoneNumber.call(this as TextEntityTypePhoneNumber);
      }
      break;
    case TextEntityTypeBankCardNumber.constructor:
      if (bankCardNumber != null) {
        return bankCardNumber.call(this as TextEntityTypeBankCardNumber);
      }
      break;
    case TextEntityTypeTonAddress.constructor:
      if (tonAddress != null) {
        return tonAddress.call(this as TextEntityTypeTonAddress);
      }
      break;
    case TextEntityTypeBold.constructor:
      if (bold != null) {
        return bold.call(this as TextEntityTypeBold);
      }
      break;
    case TextEntityTypeItalic.constructor:
      if (italic != null) {
        return italic.call(this as TextEntityTypeItalic);
      }
      break;
    case TextEntityTypeUnderline.constructor:
      if (underline != null) {
        return underline.call(this as TextEntityTypeUnderline);
      }
      break;
    case TextEntityTypeStrikethrough.constructor:
      if (strikethrough != null) {
        return strikethrough.call(this as TextEntityTypeStrikethrough);
      }
      break;
    case TextEntityTypeSpoiler.constructor:
      if (spoiler != null) {
        return spoiler.call(this as TextEntityTypeSpoiler);
      }
      break;
    case TextEntityTypeCode.constructor:
      if (code != null) {
        return code.call(this as TextEntityTypeCode);
      }
      break;
    case TextEntityTypePre.constructor:
      if (pre != null) {
        return pre.call(this as TextEntityTypePre);
      }
      break;
    case TextEntityTypePreCode.constructor:
      if (preCode != null) {
        return preCode.call(this as TextEntityTypePreCode);
      }
      break;
    case TextEntityTypeBlockQuote.constructor:
      if (blockQuote != null) {
        return blockQuote.call(this as TextEntityTypeBlockQuote);
      }
      break;
    case TextEntityTypeExpandableBlockQuote.constructor:
      if (expandableBlockQuote != null) {
        return expandableBlockQuote
            .call(this as TextEntityTypeExpandableBlockQuote);
      }
      break;
    case TextEntityTypeTextUrl.constructor:
      if (textUrl != null) {
        return textUrl.call(this as TextEntityTypeTextUrl);
      }
      break;
    case TextEntityTypeMentionName.constructor:
      if (mentionName != null) {
        return mentionName.call(this as TextEntityTypeMentionName);
      }
      break;
    case TextEntityTypeCustomEmoji.constructor:
      if (customEmoji != null) {
        return customEmoji.call(this as TextEntityTypeCustomEmoji);
      }
      break;
    case TextEntityTypeMediaTimestamp.constructor:
      if (mediaTimestamp != null) {
        return mediaTimestamp.call(this as TextEntityTypeMediaTimestamp);
      }
      break;
    case TextEntityTypeDateTime.constructor:
      if (dateTime != null) {
        return dateTime.call(this as TextEntityTypeDateTime);
      }
      break;
  }
  return orElse.call();
}