maybeMap<TResult extends Object?> method

TResult maybeMap<TResult extends Object?>({
  1. TResult telegramMessage(
    1. AuthenticationCodeTypeTelegramMessage value
    )?,
  2. TResult sms(
    1. AuthenticationCodeTypeSms value
    )?,
  3. TResult smsWord(
    1. AuthenticationCodeTypeSmsWord value
    )?,
  4. TResult smsPhrase(
    1. AuthenticationCodeTypeSmsPhrase value
    )?,
  5. TResult call(
    1. AuthenticationCodeTypeCall value
    )?,
  6. TResult flashCall(
    1. AuthenticationCodeTypeFlashCall value
    )?,
  7. TResult missedCall(
    1. AuthenticationCodeTypeMissedCall value
    )?,
  8. TResult fragment(
    1. AuthenticationCodeTypeFragment value
    )?,
  9. TResult firebaseAndroid(
    1. AuthenticationCodeTypeFirebaseAndroid value
    )?,
  10. TResult firebaseIos(
    1. AuthenticationCodeTypeFirebaseIos value
    )?,
  11. required TResult orElse(),
})

Implementation

TResult maybeMap<TResult extends Object?>({
  TResult Function(AuthenticationCodeTypeTelegramMessage value)?
      telegramMessage,
  TResult Function(AuthenticationCodeTypeSms value)? sms,
  TResult Function(AuthenticationCodeTypeSmsWord value)? smsWord,
  TResult Function(AuthenticationCodeTypeSmsPhrase value)? smsPhrase,
  TResult Function(AuthenticationCodeTypeCall value)? call,
  TResult Function(AuthenticationCodeTypeFlashCall value)? flashCall,
  TResult Function(AuthenticationCodeTypeMissedCall value)? missedCall,
  TResult Function(AuthenticationCodeTypeFragment value)? fragment,
  TResult Function(AuthenticationCodeTypeFirebaseAndroid value)?
      firebaseAndroid,
  TResult Function(AuthenticationCodeTypeFirebaseIos value)? firebaseIos,
  required TResult Function() orElse,
}) {
  switch (getConstructor()) {
    case AuthenticationCodeTypeTelegramMessage.constructor:
      if (telegramMessage != null) {
        return telegramMessage
            .call(this as AuthenticationCodeTypeTelegramMessage);
      }
      break;
    case AuthenticationCodeTypeSms.constructor:
      if (sms != null) {
        return sms.call(this as AuthenticationCodeTypeSms);
      }
      break;
    case AuthenticationCodeTypeSmsWord.constructor:
      if (smsWord != null) {
        return smsWord.call(this as AuthenticationCodeTypeSmsWord);
      }
      break;
    case AuthenticationCodeTypeSmsPhrase.constructor:
      if (smsPhrase != null) {
        return smsPhrase.call(this as AuthenticationCodeTypeSmsPhrase);
      }
      break;
    case AuthenticationCodeTypeCall.constructor:
      if (call != null) {
        return call.call(this as AuthenticationCodeTypeCall);
      }
      break;
    case AuthenticationCodeTypeFlashCall.constructor:
      if (flashCall != null) {
        return flashCall.call(this as AuthenticationCodeTypeFlashCall);
      }
      break;
    case AuthenticationCodeTypeMissedCall.constructor:
      if (missedCall != null) {
        return missedCall.call(this as AuthenticationCodeTypeMissedCall);
      }
      break;
    case AuthenticationCodeTypeFragment.constructor:
      if (fragment != null) {
        return fragment.call(this as AuthenticationCodeTypeFragment);
      }
      break;
    case AuthenticationCodeTypeFirebaseAndroid.constructor:
      if (firebaseAndroid != null) {
        return firebaseAndroid
            .call(this as AuthenticationCodeTypeFirebaseAndroid);
      }
      break;
    case AuthenticationCodeTypeFirebaseIos.constructor:
      if (firebaseIos != null) {
        return firebaseIos.call(this as AuthenticationCodeTypeFirebaseIos);
      }
      break;
  }
  return orElse.call();
}