WT 1.1.22 reengineering: Training Plan execution, registration

This commit is contained in:
bossanyit
2021-08-25 01:05:03 +02:00
parent 6b25fdfe0e
commit cebd83648b
51 changed files with 2605 additions and 663 deletions
@@ -59,10 +59,12 @@ class TrainingEvaluationBloc extends Bloc<TrainingEvaluationEvent, TrainingEvalu
trainingPlanBloc.getMyPlan()!.days[day]!.forEach((element) {
//if (!element.state.equalsTo(ExercisePlanDetailState.extra)) {
if (!findExerciseInEvaluationList(element.exerciseTypeId!)) {
addEvaluationExercise(element);
} else {
//editEvaluationExercise(element);
if (element.exerciseTypeId != null) {
if (!findExerciseInEvaluationList(element.exerciseTypeId!)) {
addEvaluationExercise(element);
} else {
//editEvaluationExercise(element);
}
}
//}
});
@@ -93,7 +95,7 @@ class TrainingEvaluationBloc extends Bloc<TrainingEvaluationEvent, TrainingEvalu
exercise.type = TrainingEvaluationExerciseType.weightBased;
this.evaluationList.add(exercise);
} else {
if (detail.exerciseType!.unitQuantityUnit == null) {
if (detail.exerciseType!.unitQuantityUnit == null || detail.weight == null) {
exercise.type = TrainingEvaluationExerciseType.repeatBased;
exercise.repeats = detail.repeats;
exercise.maxRepeats = getMaxRepeatsByExerciseType(detail.exerciseTypeId!);