maybeWhen<TResult extends Object?> method
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 id, String certificationId, String? certificationName, String userId, String? userLabel, DateTime issuedAt, DateTime? expiresAt, String status, Map<String, dynamic> evidence)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _UserCertificate() when $default != null:
return $default(_that.id,_that.certificationId,_that.certificationName,_that.userId,_that.userLabel,_that.issuedAt,_that.expiresAt,_that.status,_that.evidence);case _:
return orElse();
}
}