getTargetWeight method

double? getTargetWeight()

Gets the target weight based on the current measurement system.

Implementation

double? getTargetWeight() {
  return switch (weightUnit) {
    // If the measurement system is imperial, convert weight back to pounds.
    MeasurementSystem.imperial => _targetWeight * Conversion.kgToLbs.value,
    // If the measurement system is metric, return the weight as it is.
    _ => _targetWeight,
  };
}