composeWith method

UnitConverter composeWith(
  1. UnitConverter other
)

Composes this converter with other.

Returns a simpler converter when the composition can be reduced.

Implementation

UnitConverter composeWith(UnitConverter other) {
  if (other.isIdentity) return this;
  if (isIdentity) return other;

  var c = CompoundConverter(this, other);
  return _toLinear(c) ?? c;
}