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 orgId, String invitedUserId, String invitedByUserId, String role, String status, DateTime createdAt, DateTime? resolvedAt, String? orgName, String? inviterName, String? invitedEmail, String? invitedUsername)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _OrgInvitation() when $default != null:
return $default(_that.id,_that.orgId,_that.invitedUserId,_that.invitedByUserId,_that.role,_that.status,_that.createdAt,_that.resolvedAt,_that.orgName,_that.inviterName,_that.invitedEmail,_that.invitedUsername);case _:
return orElse();
}
}