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 assignmentId, String targetMastery, DateTime? targetDate, String status, String createdBy, DateTime createdAt, DateTime updatedAt)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _LearningObjectiveModel() when $default != null:
return $default(_that.id,_that.orgId,_that.assignmentId,_that.targetMastery,_that.targetDate,_that.status,_that.createdBy,_that.createdAt,_that.updatedAt);case _:
return orElse();
}
}