Pressure constructor
Pressure({})
Class for pressure conversions, e.g. if you want to convert 1 bar in atmosphere:
var pressure = Pressure(removeTrailingZeros: false);
pressure.convert(Unit(PRESSURE.bar, value: 1));
print(PRESSURE.atmosphere);
Implementation
Pressure(
{super.significantFigures,
super.removeTrailingZeros,
super.useScientificNotation,
name})
: super(
name: name ?? PROPERTY.pressure,
mapSymbols: {
PRESSURE.pascal: 'Pa',
PRESSURE.atmosphere: 'atm',
PRESSURE.bar: 'bar',
PRESSURE.millibar: 'mbar',
PRESSURE.psi: 'psi',
PRESSURE.torr: 'torr', //Same as mmHg
PRESSURE.hectoPascal: 'hPa',
PRESSURE.inchOfMercury: 'inHg',
},
conversionTree: ConversionNode(name: PRESSURE.pascal, children: [
ConversionNode(
coefficientProduct: 1e5,
name: PRESSURE.bar,
children: [
ConversionNode(
coefficientProduct: 1e-3,
name: PRESSURE.millibar,
),
]),
ConversionNode(
coefficientProduct: 101325.0,
name: PRESSURE.atmosphere,
),
ConversionNode(
coefficientProduct: 6894.757293168,
name: PRESSURE.psi,
),
ConversionNode(
coefficientProduct: 133.322368421,
name: PRESSURE.torr,
children: [
ConversionNode(
coefficientProduct: 25.4,
name: PRESSURE.inchOfMercury,
)
]),
ConversionNode(
coefficientProduct: 1e2,
name: PRESSURE.hectoPascal,
),
ConversionNode(
coefficientProduct: 1e3,
name: PRESSURE.kiloPascal,
)
]),
);