setTargetWeight method
Sets the target weight based on the provided weight and the current measurement system.
Implementation
void setTargetWeight(double weight) {
_targetWeight = switch (weightUnit) {
// If the measurement system is imperial, convert weight to kilograms.
MeasurementSystem.imperial => weight / Conversion.kgToLbs.value,
// If the measurement system is metric, keep weight as it is.
_ => weight,
};
}