maybeMap<TResult extends Object?> method

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

Implementation

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