MolarMass constructor
MolarMass({})
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);