diff --git a/lib/models/workouts/slot_entry.dart b/lib/models/workouts/slot_entry.dart index 92835734..609cf7d6 100644 --- a/lib/models/workouts/slot_entry.dart +++ b/lib/models/workouts/slot_entry.dart @@ -77,10 +77,10 @@ class SlotEntry { late num repetitionRounding; @JsonKey(required: false, name: 'reps_configs', includeToJson: false, defaultValue: []) - late List repsConfigs = []; + late List repetitionsConfigs = []; @JsonKey(required: false, name: 'max_reps_configs', includeToJson: false, defaultValue: []) - late List maxRepsConfigs = []; + late List maxRepetitionsConfigs = []; @JsonKey(required: true, name: 'weight_unit') late int weightUnitId; @@ -137,8 +137,8 @@ class SlotEntry { this.maxRirConfigs = const [], this.restTimeConfigs = const [], this.maxRestTimeConfigs = const [], - this.repsConfigs = const [], - this.maxRepsConfigs = const [], + this.repetitionsConfigs = const [], + this.maxRepetitionsConfigs = const [], RepetitionUnit? repetitionUnit, WeightUnit? weightUnit, Exercise? exercise, @@ -186,8 +186,8 @@ class SlotEntry { bool get hasProgressionRules { return weightConfigs.length > 1 || - repsConfigs.length > 1 || - maxRepsConfigs.length > 1 || + repetitionsConfigs.length > 1 || + maxRepetitionsConfigs.length > 1 || nrOfSetsConfigs.length > 1 || maxNrOfSetsConfigs.length > 1 || rirConfigs.length > 1 || @@ -209,9 +209,9 @@ class SlotEntry { case ConfigType.maxSets: return maxNrOfSetsConfigs; case ConfigType.reps: - return repsConfigs; + return repetitionsConfigs; case ConfigType.maxReps: - return maxRepsConfigs; + return maxRepetitionsConfigs; case ConfigType.rir: return rirConfigs; case ConfigType.maxRir: diff --git a/lib/models/workouts/slot_entry.g.dart b/lib/models/workouts/slot_entry.g.dart index 2d2a99b3..e576ac03 100644 --- a/lib/models/workouts/slot_entry.g.dart +++ b/lib/models/workouts/slot_entry.g.dart @@ -66,11 +66,11 @@ SlotEntry _$SlotEntryFromJson(Map json) { ?.map((e) => BaseConfig.fromJson(e as Map)) .toList() ?? [], - repsConfigs: (json['reps_configs'] as List?) + repetitionsConfigs: (json['reps_configs'] as List?) ?.map((e) => BaseConfig.fromJson(e as Map)) .toList() ?? [], - maxRepsConfigs: (json['max_reps_configs'] as List?) + maxRepetitionsConfigs: (json['max_reps_configs'] as List?) ?.map((e) => BaseConfig.fromJson(e as Map)) .toList() ?? [], diff --git a/lib/widgets/routines/forms/slot.dart b/lib/widgets/routines/forms/slot.dart index a8a1d9aa..0d3cafe5 100644 --- a/lib/widgets/routines/forms/slot.dart +++ b/lib/widgets/routines/forms/slot.dart @@ -102,11 +102,11 @@ class _SlotEntryFormState extends State { maxWeightController.text = widget.entry.maxWeightConfigs.first.value.toString(); } - if (widget.entry.repsConfigs.isNotEmpty) { - repsController.text = widget.entry.repsConfigs.first.value.round().toString(); + if (widget.entry.repetitionsConfigs.isNotEmpty) { + repsController.text = widget.entry.repetitionsConfigs.first.value.round().toString(); } - if (widget.entry.maxRepsConfigs.isNotEmpty) { - maxRepsController.text = widget.entry.maxRepsConfigs.first.value.round().toString(); + if (widget.entry.maxRepetitionsConfigs.isNotEmpty) { + maxRepsController.text = widget.entry.maxRepetitionsConfigs.first.value.round().toString(); } if (widget.entry.restTimeConfigs.isNotEmpty) { diff --git a/test/workout/slot_entry_model_test.dart b/test/workout/slot_entry_model_test.dart index 8d932bce..96fde3b0 100644 --- a/test/workout/slot_entry_model_test.dart +++ b/test/workout/slot_entry_model_test.dart @@ -37,9 +37,9 @@ void main() { expect(slotEntry.repetitionRounding, 1.25); expect(slotEntry.weightUnitId, 1); expect(slotEntry.weightRounding, 2.5); - expect(slotEntry.repsConfigs.length, 1); - expect(slotEntry.repsConfigs[0].id, 139); - expect(slotEntry.maxRepsConfigs.length, 1); + expect(slotEntry.repetitionsConfigs.length, 1); + expect(slotEntry.repetitionsConfigs[0].id, 139); + expect(slotEntry.maxRepetitionsConfigs.length, 1); expect(slotEntry.weightConfigs.length, 1); expect(slotEntry.maxWeightConfigs.length, 1); expect(slotEntry.nrOfSetsConfigs.length, 1); diff --git a/test_data/routines.dart b/test_data/routines.dart index 4f3cf48d..7d69f1f4 100644 --- a/test_data/routines.dart +++ b/test_data/routines.dart @@ -126,7 +126,7 @@ Routine getTestRoutine({List? exercises}) { nrOfSetsConfigs: [ BaseConfig.firstIteration(4, 1), ], - repsConfigs: [ + repetitionsConfigs: [ BaseConfig.firstIteration(3, 1), ], weightConfigs: [ @@ -170,7 +170,7 @@ Routine getTestRoutine({List? exercises}) { weightConfigs: [ BaseConfig.firstIteration(80, 1), ], - repsConfigs: [ + repetitionsConfigs: [ BaseConfig.firstIteration(5, 1), ], nrOfSetsConfigs: [ @@ -198,7 +198,7 @@ Routine getTestRoutine({List? exercises}) { nrOfSetsConfigs: [ BaseConfig.firstIteration(4, 1), ], - repsConfigs: [ + repetitionsConfigs: [ BaseConfig.firstIteration(12, 1), ], weightConfigs: [