Unit constructor

const Unit(
  1. String name,
  2. double multiplier,
  3. UnitType type
)

Primary constructor

Defines the units behaviour and identity. name is the name of the unit. type is one of the UnitType types, for custom units this has no functional effect. The primary parameter is multiplier and it is the one that is actually used by the formatting code to generate the final amount from the input. It is the number, ny which one must divide a input number, to get a appropriate amount for this particular unit. For example 1024, in the case of Unit.kibibyte.

Implementation

const Unit(this.name, this.multiplier, this.type);