WorkoutGoal constructor
const
WorkoutGoal({
- required WorkoutGoalType type,
- double? targetValue,
- Duration? targetDuration,
- WorkoutGoalUnit? unit,
Creates a new workout goal
Implementation
const WorkoutGoal({
required this.type,
this.targetValue,
this.targetDuration,
this.unit,
}) : assert(
(type == WorkoutGoalType.distance && targetValue != null) ||
(type == WorkoutGoalType.time && targetDuration != null) ||
(type == WorkoutGoalType.energy && targetValue != null) ||
type == WorkoutGoalType.open,
'targetValue is required for distance type, targetDuration is required for time type, targetValue is required for energy type',
);