when<TResult extends Object?> method
- @optionalTypeArgs
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 domain, List<String> chains, String nonce, String uri, CacaoHeader? type, String? exp, String? nbf, String? statement, String? requestId, List<String>? resources, int? expiry, Map<String, List<String>>? signatureTypes, @Deprecated('`methods` will be deprecated soon. Please use `connect` with `authentication` param') List<String>? methods) $default,) {final _that = this;
switch (_that) {
case _SessionAuthRequestParams():
return $default(_that.domain,_that.chains,_that.nonce,_that.uri,_that.type,_that.exp,_that.nbf,_that.statement,_that.requestId,_that.resources,_that.expiry,_that.signatureTypes,_that.methods);}
}