getTargetWater method

double? getTargetWater()

Gets the target water volume based on the current measurement system.

Implementation

double? getTargetWater() {
  return switch (weightUnit) {
    // If the measurement system is imperial, convert water volume back to milliliters and format the result.
    MeasurementSystem.imperial =>
      (_targetWater * Conversion.mlToOz.value).parseFormatted(),
    // If the measurement system is metric, return the water volume as it is and format the result.
    _ => _targetWater.parseFormatted(),
  };
}