maybeWhen<TResult extends Object?> method
- @optionalTypeArgs
- TResult $default()?, {
- 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( String clientId, String applicationType, String clientName, String clientUri, bool dpopBoundAccessTokens, List<String> grantTypes, @JsonKey(name: 'redirect_uris_OLD') List<String> redirectUrisOLD, List<String> redirectUris, List<String> responseTypes, String scope, String tokenEndpointAuthMethod)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _OAuthClientMetadata() when $default != null:
return $default(_that.clientId,_that.applicationType,_that.clientName,_that.clientUri,_that.dpopBoundAccessTokens,_that.grantTypes,_that.redirectUrisOLD,_that.redirectUris,_that.responseTypes,_that.scope,_that.tokenEndpointAuthMethod);case _:
return orElse();
}
}