Skip to content

Commit cacb89f

Browse files
committed
Replace WEIGHT_UNIT_KG_ID
No need to have two constants for the same thing
1 parent 94cef02 commit cacb89f

File tree

3 files changed

+2
-5
lines changed

3 files changed

+2
-5
lines changed

lib/helpers/consts.dart

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ const TESTSERVER_PASSWORD = 'flutteruser';
3434
/// Keys used in the android manifest
3535
const MANIFEST_KEY_CHECK_UPDATE = 'wger.check_min_app_version';
3636

37-
/// Default weight unit is "kg"
38-
const WEIGHT_UNIT_KG_ID = 1;
39-
4037
/// Default impression for a workout session (neutral)
4138
const DEFAULT_IMPRESSION = 2;
4239

lib/models/workouts/slot_entry.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ class SlotEntry {
173173
this.type = type ?? 'normal';
174174
exerciseObj = exercise;
175175
exerciseId = exercise.id!;
176-
this.weightUnitId = weightUnitId ?? WEIGHT_UNIT_KG_ID;
176+
this.weightUnitId = weightUnitId ?? WEIGHT_UNIT_KG;
177177
this.weightRounding = weightRounding ?? 2.5;
178178

179179
this.repetitionUnitId = repetitionUnitId ?? REP_UNIT_REPETITIONS_ID;

lib/providers/routines.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ class RoutinesProvider with ChangeNotifier {
105105

106106
/// Return the default weight unit (kg)
107107
WeightUnit get defaultWeightUnit {
108-
return _weightUnits.firstWhere((element) => element.id == WEIGHT_UNIT_KG_ID);
108+
return _weightUnits.firstWhere((element) => element.id == WEIGHT_UNIT_KG);
109109
}
110110

111111
WeightUnit findWeightUnitById(int id) => _weightUnits.firstWhere((element) => element.id == id);

0 commit comments

Comments
 (0)