maybeMap<TResult extends Object?> method

TResult maybeMap<TResult extends Object?>({
  1. TResult allowCalls(
    1. UserPrivacySettingAllowCalls value
    )?,
  2. TResult allowChatInvites(
    1. UserPrivacySettingAllowChatInvites value
    )?,
  3. TResult allowFindingByPhoneNumber(
    1. UserPrivacySettingAllowFindingByPhoneNumber value
    )?,
  4. TResult allowPeerToPeerCalls(
    1. UserPrivacySettingAllowPeerToPeerCalls value
    )?,
  5. TResult allowPrivateVoiceAndVideoNoteMessages(
    1. UserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages value
    )?,
  6. TResult allowUnpaidMessages(
    1. UserPrivacySettingAllowUnpaidMessages value
    )?,
  7. TResult autosaveGifts(
    1. UserPrivacySettingAutosaveGifts value
    )?,
  8. TResult showBio(
    1. UserPrivacySettingShowBio value
    )?,
  9. TResult showBirthdate(
    1. UserPrivacySettingShowBirthdate value
    )?,
  10. TResult showLinkInForwardedMessages(
    1. UserPrivacySettingShowLinkInForwardedMessages value
    )?,
  11. TResult showPhoneNumber(
    1. UserPrivacySettingShowPhoneNumber value
    )?,
  12. TResult showProfileAudio(
    1. UserPrivacySettingShowProfileAudio value
    )?,
  13. TResult showProfilePhoto(
    1. UserPrivacySettingShowProfilePhoto value
    )?,
  14. TResult showStatus(
    1. UserPrivacySettingShowStatus value
    )?,
  15. required TResult orElse(),
})

Implementation

TResult maybeMap<TResult extends Object?>({
  TResult Function(UserPrivacySettingAllowCalls value)? allowCalls,
  TResult Function(UserPrivacySettingAllowChatInvites value)?
  allowChatInvites,
  TResult Function(UserPrivacySettingAllowFindingByPhoneNumber value)?
  allowFindingByPhoneNumber,
  TResult Function(UserPrivacySettingAllowPeerToPeerCalls value)?
  allowPeerToPeerCalls,
  TResult Function(
    UserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages value,
  )?
  allowPrivateVoiceAndVideoNoteMessages,
  TResult Function(UserPrivacySettingAllowUnpaidMessages value)?
  allowUnpaidMessages,
  TResult Function(UserPrivacySettingAutosaveGifts value)? autosaveGifts,
  TResult Function(UserPrivacySettingShowBio value)? showBio,
  TResult Function(UserPrivacySettingShowBirthdate value)? showBirthdate,
  TResult Function(UserPrivacySettingShowLinkInForwardedMessages value)?
  showLinkInForwardedMessages,
  TResult Function(UserPrivacySettingShowPhoneNumber value)? showPhoneNumber,
  TResult Function(UserPrivacySettingShowProfileAudio value)?
  showProfileAudio,
  TResult Function(UserPrivacySettingShowProfilePhoto value)?
  showProfilePhoto,
  TResult Function(UserPrivacySettingShowStatus value)? showStatus,
  required TResult Function() orElse,
}) {
  switch (getConstructor()) {
    case UserPrivacySettingAllowCalls.constructor:
      if (allowCalls != null) {
        return allowCalls.call(this as UserPrivacySettingAllowCalls);
      }
      break;
    case UserPrivacySettingAllowChatInvites.constructor:
      if (allowChatInvites != null) {
        return allowChatInvites.call(
          this as UserPrivacySettingAllowChatInvites,
        );
      }
      break;
    case UserPrivacySettingAllowFindingByPhoneNumber.constructor:
      if (allowFindingByPhoneNumber != null) {
        return allowFindingByPhoneNumber.call(
          this as UserPrivacySettingAllowFindingByPhoneNumber,
        );
      }
      break;
    case UserPrivacySettingAllowPeerToPeerCalls.constructor:
      if (allowPeerToPeerCalls != null) {
        return allowPeerToPeerCalls.call(
          this as UserPrivacySettingAllowPeerToPeerCalls,
        );
      }
      break;
    case UserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages.constructor:
      if (allowPrivateVoiceAndVideoNoteMessages != null) {
        return allowPrivateVoiceAndVideoNoteMessages.call(
          this as UserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages,
        );
      }
      break;
    case UserPrivacySettingAllowUnpaidMessages.constructor:
      if (allowUnpaidMessages != null) {
        return allowUnpaidMessages.call(
          this as UserPrivacySettingAllowUnpaidMessages,
        );
      }
      break;
    case UserPrivacySettingAutosaveGifts.constructor:
      if (autosaveGifts != null) {
        return autosaveGifts.call(this as UserPrivacySettingAutosaveGifts);
      }
      break;
    case UserPrivacySettingShowBio.constructor:
      if (showBio != null) {
        return showBio.call(this as UserPrivacySettingShowBio);
      }
      break;
    case UserPrivacySettingShowBirthdate.constructor:
      if (showBirthdate != null) {
        return showBirthdate.call(this as UserPrivacySettingShowBirthdate);
      }
      break;
    case UserPrivacySettingShowLinkInForwardedMessages.constructor:
      if (showLinkInForwardedMessages != null) {
        return showLinkInForwardedMessages.call(
          this as UserPrivacySettingShowLinkInForwardedMessages,
        );
      }
      break;
    case UserPrivacySettingShowPhoneNumber.constructor:
      if (showPhoneNumber != null) {
        return showPhoneNumber.call(
          this as UserPrivacySettingShowPhoneNumber,
        );
      }
      break;
    case UserPrivacySettingShowProfileAudio.constructor:
      if (showProfileAudio != null) {
        return showProfileAudio.call(
          this as UserPrivacySettingShowProfileAudio,
        );
      }
      break;
    case UserPrivacySettingShowProfilePhoto.constructor:
      if (showProfilePhoto != null) {
        return showProfilePhoto.call(
          this as UserPrivacySettingShowProfilePhoto,
        );
      }
      break;
    case UserPrivacySettingShowStatus.constructor:
      if (showStatus != null) {
        return showStatus.call(this as UserPrivacySettingShowStatus);
      }
      break;
  }
  return orElse.call();
}