Temperature constructor

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

Class for temperature conversions, e.g. if you want to convert 1 celsius in kelvin:

var temperature = Temperature(removeTrailingZeros: false);
temperature.convert(Unit(TEMPERATURE.celsius, value: 1));
print(TEMPERATURE.kelvin);

Implementation

Temperature(
    {super.significantFigures,
    super.removeTrailingZeros,
    super.useScientificNotation,
    name})
    : super(
        name: name ?? PROPERTY.temperature,
        mapSymbols: {
          TEMPERATURE.fahrenheit: '°F',
          TEMPERATURE.celsius: '°C',
          TEMPERATURE.kelvin: 'K',
          TEMPERATURE.reamur: '°Re',
          TEMPERATURE.romer: '°Rø',
          TEMPERATURE.delisle: '°De',
          TEMPERATURE.rankine: '°R',
        },
        conversionTree:
            ConversionNode(name: TEMPERATURE.fahrenheit, children: [
          ConversionNode(
              coefficientProduct: 1.8,
              coefficientSum: 32.0,
              name: TEMPERATURE.celsius,
              children: [
                ConversionNode(
                  coefficientSum: -273.15,
                  name: TEMPERATURE.kelvin,
                ),
                ConversionNode(
                  coefficientProduct: 5 / 4,
                  name: TEMPERATURE.reamur,
                ),
                ConversionNode(
                  coefficientProduct: 40 / 21,
                  coefficientSum: -100 / 7,
                  name: TEMPERATURE.romer,
                ),
                ConversionNode(
                  coefficientProduct: -2 / 3,
                  coefficientSum: 100,
                  name: TEMPERATURE.delisle,
                ),
              ]),
          ConversionNode(
            coefficientSum: -459.67,
            name: TEMPERATURE.rankine,
          ),
        ]),
      );