when<TResult extends Object?> method
- @optionalTypeArgs
- TResult $default(
- String? issuer,
- String? authorizationEndpoint,
- String? tokenEndpoint,
- String? deviceAuthorizationEndpoint,
- String? userinfoEndpoint,
- String? mfaChallengeEndpoint,
- String? jwksUri,
- String? registrationEndpoint,
- String? revocationEndpoint,
- List<
String> ? scopesSupported, - List<
String> ? responseTypesSupported, - List<
String> ? codeChallengeMethodsSupported, - List<
String> ? responseModesSupported, - List<
String> ? subjectTypesSupported, - List<
String> ? idTokenSigningAlgValuesSupported, - List<
String> ? tokenEndpointAuthMethodsSupported, - List<
String> ? claimsSupported, - bool? requestUriParameterSupported,
- bool? requestParameterSupported,
- List<
String> ? tokenEndpointAuthSigningAlgValuesSupported,
A switch-like method, using callbacks.
As opposed to map, this offers destructuring.
It is equivalent to doing:
switch (sealedClass) {
case Subclass(:final field):
return ...;
case Subclass2(:final field2):
return ...;
}
Implementation
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String? issuer, @JsonKey(name: 'authorization_endpoint') String? authorizationEndpoint, @JsonKey(name: 'token_endpoint') String? tokenEndpoint, @JsonKey(name: 'device_authorization_endpoint') String? deviceAuthorizationEndpoint, @JsonKey(name: 'userinfo_endpoint') String? userinfoEndpoint, @JsonKey(name: 'mfa_challenge_endpoint') String? mfaChallengeEndpoint, @JsonKey(name: 'jwks_uri') String? jwksUri, @JsonKey(name: 'registration_endpoint') String? registrationEndpoint, @JsonKey(name: 'revocation_endpoint') String? revocationEndpoint, @JsonKey(name: 'scopes_supported') List<String>? scopesSupported, @JsonKey(name: 'response_types_supported') List<String>? responseTypesSupported, @JsonKey(name: 'code_challenge_methods_supported') List<String>? codeChallengeMethodsSupported, @JsonKey(name: 'response_modes_supported') List<String>? responseModesSupported, @JsonKey(name: 'subject_types_supported') List<String>? subjectTypesSupported, @JsonKey(name: 'id_token_signing_alg_values_supported') List<String>? idTokenSigningAlgValuesSupported, @JsonKey(name: 'token_endpoint_auth_methods_supported') List<String>? tokenEndpointAuthMethodsSupported, @JsonKey(name: 'claims_supported') List<String>? claimsSupported, @JsonKey(name: 'request_uri_parameter_supported') bool? requestUriParameterSupported, @JsonKey(name: 'request_parameter_supported') bool? requestParameterSupported, @JsonKey(name: 'token_endpoint_auth_signing_alg_values_supported') List<String>? tokenEndpointAuthSigningAlgValuesSupported) $default,) {final _that = this;
switch (_that) {
case _OpenId():
return $default(_that.issuer,_that.authorizationEndpoint,_that.tokenEndpoint,_that.deviceAuthorizationEndpoint,_that.userinfoEndpoint,_that.mfaChallengeEndpoint,_that.jwksUri,_that.registrationEndpoint,_that.revocationEndpoint,_that.scopesSupported,_that.responseTypesSupported,_that.codeChallengeMethodsSupported,_that.responseModesSupported,_that.subjectTypesSupported,_that.idTokenSigningAlgValuesSupported,_that.tokenEndpointAuthMethodsSupported,_that.claimsSupported,_that.requestUriParameterSupported,_that.requestParameterSupported,_that.tokenEndpointAuthSigningAlgValuesSupported);case _:
throw StateError('Unexpected subclass');
}
}