maybeWhen<TResult extends Object?> method
TResult
maybeWhen<TResult extends Object?>(
- TResult $default(
- @JsonKey.new(toJson: UserInterfaceStyleKey.toJson) ThemeMode? style,
- PaymentSheetAppearance? appearance,
- String? setupIntentClientSecret,
- String customerId,
- String customerEphemeralKeySecret,
- String? merchantDisplayName,
- bool? allowsRemovalOfLastSavedPaymentMethod,
- String? headerTextForSelectionScreen,
- BillingDetails? defaultBillingDetails,
- BillingDetailsCollectionConfiguration? billingDetailsCollectionConfiguration,
- String? returnURL,
- String? removeSavedPaymentMethodMessage,
- bool applePayEnabled,
- bool googlePayEnabled,
- @JsonKey.new(toJson: _cardBrandListToJson) List<
CardBrand> ? preferredNetworks, - CardBrandAcceptance? cardBrandAcceptance,
- bool? opensCardScannerAutomatically,
- TResult adapter(
- String? setupIntentClientSecret,
- String customerId,
- IntentConfiguration? intentConfiguration,
- String? customerEphemeralKeySecret,
- @JsonKey.new(toJson: UserInterfaceStyleKey.toJson) ThemeMode? style,
- PaymentSheetAppearance? appearance,
- String? merchantDisplayName,
- bool? allowsRemovalOfLastSavedPaymentMethod,
- String? headerTextForSelectionScreen,
- BillingDetails? defaultBillingDetails,
- BillingDetailsCollectionConfiguration? billingDetailsCollectionConfiguration,
- String? returnURL,
- String? removeSavedPaymentMethodMessage,
- bool applePayEnabled,
- bool googlePayEnabled,
- @JsonKey.new(toJson: _cardBrandListToJson) List<
CardBrand> ? preferredNetworks, - CardBrandAcceptance? cardBrandAcceptance,
- TResult session(
- String? setupIntentClientSecret,
- String? customerId,
- IntentConfiguration intentConfiguration,
- String? customerEphemeralKeySecret,
- @JsonKey.new(toJson: UserInterfaceStyleKey.toJson) ThemeMode? style,
- PaymentSheetAppearance? appearance,
- String? merchantDisplayName,
- bool? allowsRemovalOfLastSavedPaymentMethod,
- String? headerTextForSelectionScreen,
- BillingDetails? defaultBillingDetails,
- BillingDetailsCollectionConfiguration? billingDetailsCollectionConfiguration,
- String? returnURL,
- String? removeSavedPaymentMethodMessage,
- bool applePayEnabled,
- bool googlePayEnabled,
- @JsonKey.new(toJson: _cardBrandListToJson) List<
CardBrand> ? preferredNetworks, - CardBrandAcceptance? cardBrandAcceptance,
- required TResult orElse(),
A variant of when that fallback to an orElse callback.
It is equivalent to doing:
switch (sealedClass) {
case Subclass(:final field):
return ...;
case _:
return orElse();
}
Implementation
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function(@JsonKey(toJson: UserInterfaceStyleKey.toJson) ThemeMode? style, PaymentSheetAppearance? appearance, String? setupIntentClientSecret, String customerId, String customerEphemeralKeySecret, String? merchantDisplayName, bool? allowsRemovalOfLastSavedPaymentMethod, String? headerTextForSelectionScreen, BillingDetails? defaultBillingDetails, BillingDetailsCollectionConfiguration? billingDetailsCollectionConfiguration, String? returnURL, String? removeSavedPaymentMethodMessage, bool applePayEnabled, bool googlePayEnabled, @JsonKey(toJson: _cardBrandListToJson) List<CardBrand>? preferredNetworks, CardBrandAcceptance? cardBrandAcceptance, bool? opensCardScannerAutomatically)? $default,{TResult Function( String? setupIntentClientSecret, String customerId, IntentConfiguration? intentConfiguration, String? customerEphemeralKeySecret, @JsonKey(toJson: UserInterfaceStyleKey.toJson) ThemeMode? style, PaymentSheetAppearance? appearance, String? merchantDisplayName, bool? allowsRemovalOfLastSavedPaymentMethod, String? headerTextForSelectionScreen, BillingDetails? defaultBillingDetails, BillingDetailsCollectionConfiguration? billingDetailsCollectionConfiguration, String? returnURL, String? removeSavedPaymentMethodMessage, bool applePayEnabled, bool googlePayEnabled, @JsonKey(toJson: _cardBrandListToJson) List<CardBrand>? preferredNetworks, CardBrandAcceptance? cardBrandAcceptance)? adapter,TResult Function( String? setupIntentClientSecret, String? customerId, IntentConfiguration intentConfiguration, String? customerEphemeralKeySecret, @JsonKey(toJson: UserInterfaceStyleKey.toJson) ThemeMode? style, PaymentSheetAppearance? appearance, String? merchantDisplayName, bool? allowsRemovalOfLastSavedPaymentMethod, String? headerTextForSelectionScreen, BillingDetails? defaultBillingDetails, BillingDetailsCollectionConfiguration? billingDetailsCollectionConfiguration, String? returnURL, String? removeSavedPaymentMethodMessage, bool applePayEnabled, bool googlePayEnabled, @JsonKey(toJson: _cardBrandListToJson) List<CardBrand>? preferredNetworks, CardBrandAcceptance? cardBrandAcceptance)? session,required TResult orElse(),}) {final _that = this;
switch (_that) {
case _CustomerSheetInitParamsDeprecated() when $default != null:
return $default(_that.style,_that.appearance,_that.setupIntentClientSecret,_that.customerId,_that.customerEphemeralKeySecret,_that.merchantDisplayName,_that.allowsRemovalOfLastSavedPaymentMethod,_that.headerTextForSelectionScreen,_that.defaultBillingDetails,_that.billingDetailsCollectionConfiguration,_that.returnURL,_that.removeSavedPaymentMethodMessage,_that.applePayEnabled,_that.googlePayEnabled,_that.preferredNetworks,_that.cardBrandAcceptance,_that.opensCardScannerAutomatically);case _CustomerSheetInitParamsAdapter() when adapter != null:
return adapter(_that.setupIntentClientSecret,_that.customerId,_that.intentConfiguration,_that.customerEphemeralKeySecret,_that.style,_that.appearance,_that.merchantDisplayName,_that.allowsRemovalOfLastSavedPaymentMethod,_that.headerTextForSelectionScreen,_that.defaultBillingDetails,_that.billingDetailsCollectionConfiguration,_that.returnURL,_that.removeSavedPaymentMethodMessage,_that.applePayEnabled,_that.googlePayEnabled,_that.preferredNetworks,_that.cardBrandAcceptance);case _CustomerSheetInitParamsSession() when session != null:
return session(_that.setupIntentClientSecret,_that.customerId,_that.intentConfiguration,_that.customerEphemeralKeySecret,_that.style,_that.appearance,_that.merchantDisplayName,_that.allowsRemovalOfLastSavedPaymentMethod,_that.headerTextForSelectionScreen,_that.defaultBillingDetails,_that.billingDetailsCollectionConfiguration,_that.returnURL,_that.removeSavedPaymentMethodMessage,_that.applePayEnabled,_that.googlePayEnabled,_that.preferredNetworks,_that.cardBrandAcceptance);case _:
return orElse();
}
}