Replace WEIGHT_UNIT_KG_ID

No need to have two constants for the same thing
This commit is contained in:
Roland Geider
2025-03-28 12:53:56 +01:00
parent 94cef0278c
commit cacb89f8b1
3 changed files with 2 additions and 5 deletions

View File

@@ -34,9 +34,6 @@ const TESTSERVER_PASSWORD = 'flutteruser';
/// Keys used in the android manifest
const MANIFEST_KEY_CHECK_UPDATE = 'wger.check_min_app_version';
/// Default weight unit is "kg"
const WEIGHT_UNIT_KG_ID = 1;
/// Default impression for a workout session (neutral)
const DEFAULT_IMPRESSION = 2;

View File

@@ -173,7 +173,7 @@ class SlotEntry {
this.type = type ?? 'normal';
exerciseObj = exercise;
exerciseId = exercise.id!;
this.weightUnitId = weightUnitId ?? WEIGHT_UNIT_KG_ID;
this.weightUnitId = weightUnitId ?? WEIGHT_UNIT_KG;
this.weightRounding = weightRounding ?? 2.5;
this.repetitionUnitId = repetitionUnitId ?? REP_UNIT_REPETITIONS_ID;

View File

@@ -105,7 +105,7 @@ class RoutinesProvider with ChangeNotifier {
/// Return the default weight unit (kg)
WeightUnit get defaultWeightUnit {
return _weightUnits.firstWhere((element) => element.id == WEIGHT_UNIT_KG_ID);
return _weightUnits.firstWhere((element) => element.id == WEIGHT_UNIT_KG);
}
WeightUnit findWeightUnitById(int id) => _weightUnits.firstWhere((element) => element.id == id);