CustomConversion constructor

CustomConversion({
  1. required Node conversionTree,
  2. required Map<dynamic, String?> mapSymbols,
  3. dynamic name,
  4. int significantFigures = 10,
  5. bool removeTrailingZeros = true,
  6. bool useScientificNotation = true,
})

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

CustomConversion(
    {required this.conversionTree,
    required this.mapSymbols,
    name,
    this.significantFigures = 10,
    this.removeTrailingZeros = true,
    this.useScientificNotation = true}) {
  this.name = name;
  size = mapSymbols.length;
  mapSymbols.forEach((key, value) => _unitList.add(Unit(key, symbol: value)));
  _nodeList = conversionTree.getTreeAsList();
}