convertMassOrWeight function

double convertMassOrWeight({
  1. required double massOrWeight,
  2. required WeightOrMassUnit from,
  3. 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;
}