Rename some constants so they are the same as in the react app

This commit is contained in:
Roland Geider
2023-05-19 19:17:40 +02:00
parent a027ea14c9
commit 84bdb56b65
3 changed files with 8 additions and 4 deletions

View File

@@ -36,8 +36,12 @@ const DEFAULT_WEIGHT_UNIT = 1;
/// Default impression for a workout session (neutral)
const DEFAULT_IMPRESSION = 2;
/// Default weight unit is "repetition"
const DEFAULT_REPETITION_UNIT = 1;
// Weight and repetition units for the workout logs
const REP_UNIT_REPETITIONS = 1;
const REP_UNIT_TILL_FAILURE = 2;
const WEIGHT_UNIT_KG = 1;
const WEIGHT_UNIT_LB = 2;
/// Time to locally cache values such as ingredients, etc
const DAYS_TO_CACHE = 20;

View File

@@ -42,7 +42,7 @@ String repText(
// rather "8 repetitions". If there is weight we want to output "8 x 50kg",
// since the repetitions are implied. If other units are used, we always
// print them
if (repetitionUnitObj.id != DEFAULT_REPETITION_UNIT || weight == 0 || weight == null) {
if (repetitionUnitObj.id != REP_UNIT_REPETITIONS || weight == 0 || weight == null) {
out.add(repetitionUnitObj.name);
}
}

View File

@@ -85,7 +85,7 @@ class WorkoutPlansProvider with ChangeNotifier {
/// Return the default weight unit (reps)
RepetitionUnit get defaultRepetitionUnit {
return _repetitionUnit.firstWhere((element) => element.id == DEFAULT_REPETITION_UNIT);
return _repetitionUnit.firstWhere((element) => element.id == REP_UNIT_REPETITIONS);
}
List<WorkoutPlan> getPlans() {