map<TResult extends Object?> method
TResult
map<TResult extends Object?>({
- required TResult googlePay(
- PlatformPayPaymentMethodParamsGooglePay value
- required TResult applePay(
- PlatformPayPaymentMethodParamsApplePay value
- required TResult web(
- PlatformPayPaymentMethodParamsWeb value
A switch-like method, using callbacks.
Callbacks receives the raw object, upcasted. It is equivalent to doing:
switch (sealedClass) {
case final Subclass value:
return ...;
case final Subclass2 value:
return ...;
}
Implementation
@optionalTypeArgs TResult map<TResult extends Object?>({required TResult Function( PlatformPayPaymentMethodParamsGooglePay value) googlePay,required TResult Function( PlatformPayPaymentMethodParamsApplePay value) applePay,required TResult Function( PlatformPayPaymentMethodParamsWeb value) web,}){
final _that = this;
switch (_that) {
case PlatformPayPaymentMethodParamsGooglePay():
return googlePay(_that);case PlatformPayPaymentMethodParamsApplePay():
return applePay(_that);case PlatformPayPaymentMethodParamsWeb():
return web(_that);}
}