Angle constructor

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

Class for angle conversions, e.g. if you want to convert 1 radiant in degree:

var angle = Angle(removeTrailingZeros: false);
angle.convert(Unit(ANGLE.radians, value: 1));
print(ANGLE.degree);

Implementation

Angle(
    {super.significantFigures,
    super.removeTrailingZeros,
    super.useScientificNotation,
    name})
    : super(
        name: name ?? PROPERTY.angle,
        mapSymbols: {
          ANGLE.degree: '°',
          ANGLE.minutes: "'",
          ANGLE.seconds: "''",
          ANGLE.radians: 'rad',
        },
        conversionTree: ConversionNode(name: ANGLE.degree, children: [
          ConversionNode(
            coefficientProduct: 1 / 60,
            name: ANGLE.minutes,
          ),
          ConversionNode(
            coefficientProduct: 1 / 3600,
            name: ANGLE.seconds,
          ),
          ConversionNode(
            coefficientProduct: 57.295779513,
            name: ANGLE.radians,
          ),
        ]),
      );