Density constructor
Density({})
Class for density conversions, e.g. if you want to convert 1 gram per liter in kilograms per liter:
var density = Density(removeTrailingZeros: false);
density.convert(Unit(DENSITY.gramsPerLiter, value: 1));
print(DENSITY.kilogramsPerLiter);
Implementation
Density(
{super.significantFigures,
super.removeTrailingZeros,
super.useScientificNotation,
name})
: assert(_mapSymbols.length == DENSITY.values.length),
super(
name: name ?? PROPERTY.density,
numeratorProperty:
getPropertyFromEnum(DENSITY.values[0].numerator)!,
denominatorProperty:
getPropertyFromEnum(DENSITY.values[0].denominator)!,
mapSymbols: _mapSymbols);