allExerciseModes function
- GeneratorDetails? details
Returns all exercise modes for the device represented by the given generator details.
This list includes modes which are not supported by the device, but which are supported by Kohler in general.
It excludes ExerciseMode.none. It also excludes ExerciseMode.ecoCycle unless the device supports it.
Implementation
List<ExerciseMode> allExerciseModes(GeneratorDetails? details) {
final allModes =
ExerciseMode.values.where((mode) => mode != ExerciseMode.none);
if (supportsEcoCycleMode(details?.modelNumber)) {
return allModes.toList();
}
return allModes.where((mode) => mode != ExerciseMode.ecoCycle).toList();
}