MolarMass constructor

MolarMass({
  1. int significantFigures = 10,
  2. bool removeTrailingZeros = true,
  3. bool useScientificNotation = true,
  4. dynamic name,
})

Class for molar mass conversions, e.g. if you want to convert 1 gram per mole to kilograms per mole:

var molarMass = MolarMass(removeTrailingZeros: false);
molarMass.convert(Unit(MOLAR_MASS.gramsPerMole, value: 1));
print(MOLAR_MASS.kilogramsPerMole);

Implementation

MolarMass(
    {super.significantFigures,
    super.removeTrailingZeros,
    super.useScientificNotation,
    name})
    : assert(_mapSymbols.length == MOLAR_MASS.values.length),
      super(
          name: name ?? PROPERTY.molarmass,
          numeratorProperty:
              getPropertyFromEnum(MOLAR_MASS.values[0].numerator)!,
          denominatorProperty:
              getPropertyFromEnum(MOLAR_MASS.values[0].denominator)!,
          mapSymbols: _mapSymbols);