diff --git a/lib/models/workouts/set_config_data.dart b/lib/models/workouts/set_config_data.dart index 334f7aa47..57d11cda2 100644 --- a/lib/models/workouts/set_config_data.dart +++ b/lib/models/workouts/set_config_data.dart @@ -105,11 +105,11 @@ class SetConfigData { required this.weight, this.maxWeight, this.weightUnitId = WEIGHT_UNIT_KG, - this.weightRounding = 1.25, + this.weightRounding = null, required this.repetitions, this.maxRepetitions, this.repetitionsUnitId = REP_UNIT_REPETITIONS_ID, - this.repetitionsRounding = 1, + this.repetitionsRounding = null, required this.rir, this.maxRir, required this.rpe, diff --git a/lib/models/workouts/set_config_data.g.dart b/lib/models/workouts/set_config_data.g.dart index 5e74a24ee..d2a658356 100644 --- a/lib/models/workouts/set_config_data.g.dart +++ b/lib/models/workouts/set_config_data.g.dart @@ -42,13 +42,13 @@ SetConfigData _$SetConfigDataFromJson(Map json) { maxWeight: stringToNumNull(json['max_weight'] as String?), weightUnitId: (json['weight_unit'] as num?)?.toInt() ?? WEIGHT_UNIT_KG, weightRounding: json['weight_rounding'] == null - ? 1.25 + ? null : stringToNumNull(json['weight_rounding'] as String?), repetitions: stringToNumNull(json['repetitions'] as String?), maxRepetitions: stringToNumNull(json['max_repetitions'] as String?), repetitionsUnitId: (json['repetitions_unit'] as num?)?.toInt() ?? REP_UNIT_REPETITIONS_ID, repetitionsRounding: json['repetitions_rounding'] == null - ? 1 + ? null : stringToNumNull(json['repetitions_rounding'] as String?), rir: stringToNumNull(json['rir'] as String?), maxRir: stringToNumNull(json['max_rir'] as String?), diff --git a/lib/models/workouts/slot_entry.dart b/lib/models/workouts/slot_entry.dart index e68b38e25..2b57e22f7 100644 --- a/lib/models/workouts/slot_entry.dart +++ b/lib/models/workouts/slot_entry.dart @@ -73,8 +73,8 @@ class SlotEntry { @JsonKey(includeFromJson: false, includeToJson: false) late RepetitionUnit? repetitionUnitObj; - @JsonKey(required: true, name: 'repetition_rounding', fromJson: stringToNum) - late num repetitionRounding; + @JsonKey(required: true, name: 'repetition_rounding', fromJson: stringToNumNull) + late num? repetitionRounding; @JsonKey(required: false, name: 'repetitions_configs', includeToJson: false, defaultValue: []) late List repetitionsConfigs = []; @@ -88,8 +88,8 @@ class SlotEntry { @JsonKey(includeFromJson: false, includeToJson: false) late WeightUnit? weightUnitObj; - @JsonKey(required: true, name: 'weight_rounding', fromJson: stringToNum) - late num weightRounding; + @JsonKey(required: true, name: 'weight_rounding', fromJson: stringToNumNull) + late num? weightRounding; @JsonKey(required: false, name: 'weight_configs', includeToJson: false, defaultValue: []) late List weightConfigs = []; @@ -174,10 +174,10 @@ class SlotEntry { exerciseObj = exercise; exerciseId = exercise.id!; this.weightUnitId = weightUnitId ?? WEIGHT_UNIT_KG; - this.weightRounding = weightRounding ?? 2.5; + this.weightRounding = weightRounding; this.repetitionUnitId = repetitionUnitId ?? REP_UNIT_REPETITIONS_ID; - this.repetitionRounding = repetitionRounding ?? 1; + this.repetitionRounding = repetitionRounding; } get rir { diff --git a/lib/models/workouts/slot_entry.g.dart b/lib/models/workouts/slot_entry.g.dart index a37de9644..71be96ab4 100644 --- a/lib/models/workouts/slot_entry.g.dart +++ b/lib/models/workouts/slot_entry.g.dart @@ -30,9 +30,9 @@ SlotEntry _$SlotEntryFromJson(Map json) { type: json['type'] as String, exerciseId: (json['exercise'] as num).toInt(), repetitionUnitId: (json['repetition_unit'] as num?)?.toInt(), - repetitionRounding: stringToNum(json['repetition_rounding'] as String?), + repetitionRounding: stringToNumNull(json['repetition_rounding'] as String?), weightUnitId: (json['weight_unit'] as num?)?.toInt(), - weightRounding: stringToNum(json['weight_rounding'] as String?), + weightRounding: stringToNumNull(json['weight_rounding'] as String?), comment: json['comment'] as String, weightConfigs: (json['weight_configs'] as List?) ?.map((e) => BaseConfig.fromJson(e as Map))