Speed constructor

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

Class for speed conversions, e.g. if you want to convert 1 square meters in acres:

var speed = Speed(removeTrailingZeros: false);
speed.convert(Unit(SPEED.square_meters, value: 1));
print(SPEED.acres);

Implementation

Speed(
    {super.significantFigures,
    super.removeTrailingZeros,
    super.useScientificNotation,
    name})
    : super(
        name: name ?? PROPERTY.speed,
        mapSymbols: {
          SPEED.metersPerSecond: 'm/s',
          SPEED.kilometersPerHour: 'km/h',
          SPEED.milesPerHour: 'mi/h',
          SPEED.knots: 'kts',
          SPEED.feetsPerSecond: 'ft/s',
          SPEED.minutesPerKilometer: 'min/km',
        },
        conversionTree:
            ConversionNode(name: SPEED.metersPerSecond, children: [
          ConversionNode(
              coefficientProduct: 1 / 3.6,
              name: SPEED.kilometersPerHour,
              children: [
                ConversionNode(
                  coefficientProduct: 1.609344,
                  name: SPEED.milesPerHour,
                ),
                ConversionNode(
                  coefficientProduct: 1.852,
                  name: SPEED.knots,
                ),
                ConversionNode(
                  conversionType: ConversionType.reciprocalConversion,
                  coefficientProduct: 60,
                  name: SPEED.minutesPerKilometer,
                )
              ]),
          ConversionNode(
            coefficientProduct: 0.3048,
            name: SPEED.feetsPerSecond,
          ),
        ]),
      );