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(
    {this.significantFigures = 10,
    this.removeTrailingZeros = true,
    this.useScientificNotation = true,
    name}) {
  this.name = name ?? PROPERTY.angle;
  size = ANGLE.values.length;
  Node conversionTree = Node(name: ANGLE.degree, leafNodes: [
    Node(
      coefficientProduct: 1 / 60,
      name: ANGLE.minutes,
    ),
    Node(
      coefficientProduct: 1 / 3600,
      name: ANGLE.seconds,
    ),
    Node(
      coefficientProduct: 57.295779513,
      name: ANGLE.radians,
    ),
  ]);

  _customConversion = CustomConversion(
      conversionTree: conversionTree,
      mapSymbols: mapSymbols,
      significantFigures: significantFigures,
      removeTrailingZeros: removeTrailingZeros,
      useScientificNotation: useScientificNotation);
}