standardUnit property

  1. @override
Unit standardUnit
override

//////////////////////////////////////////////// //////////////////////////////////////////////// The BaseUnit base unit, AlternateUnit alternate unit or product of base units and alternate units this unit is derived from.

The standard unit identifies the "type" of Quantity quantity for which this unit is employed.

Implementation

@override
Unit get standardUnit {
  if (_hasOnlyStandardUnit()) return this;

  return _elements
      .map((v) => v.base.standardUnit.pow(v.pow))
      .fold(Unit.one, (a, b) => a.times(b));
}