isEqual method

bool isEqual(
  1. ValidatedQuantity value1,
  2. ValidatedQuantity value2
)

Implementation

bool isEqual(ValidatedQuantity value1, ValidatedQuantity value2) {
  if (isComparable(value1.unit, value2.unit)) {
    final UcumDecimal value2UcumDecimal =
        convert(value2.value, value2.unit, value1.unit);
    value2 = ValidatedQuantity(value: value2UcumDecimal, unit: value1.unit);
    return value1.value.equalsValue(value2.value);
  } else {
    return false;
  }
}