exerciseModeToScheduleApi function
- ExerciseMode? mode
Returns the ExerciseScheduleModeDTO for the given exercise mode.
It maps unsupported exercise modes to null.
Implementation
ExerciseScheduleModeDTO? exerciseModeToScheduleApi(ExerciseMode? mode) {
switch (mode) {
case ExerciseMode.none:
case null:
return null;
case ExerciseMode.unloaded:
return ExerciseScheduleModeDTO.unloaded;
case ExerciseMode.unloadedFullSpeed:
return ExerciseScheduleModeDTO.unloadedfullspeed;
case ExerciseMode.loadedFullSpeed:
return ExerciseScheduleModeDTO.loadedfullspeed;
case ExerciseMode.ecoCycle:
return ExerciseScheduleModeDTO.ecoexercise;
}
}