convertMassOrWeight function
double
convertMassOrWeight({
- required double massOrWeight,
- required WeightOrMassUnit from,
- required WeightOrMassUnit to,
Implementation
double convertMassOrWeight({
required double massOrWeight,
required WeightOrMassUnit from,
required WeightOrMassUnit to,
}){
double kilograms = massOrWeight * massAndWeightTable[from]!;
double result = kilograms / massAndWeightTable[to]!;
return result;
}