Force constructor

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

Class for force conversions, e.g. if you want to convert 1 newton in pound force:

var force = Force(removeTrailingZeros: false);
force.Convert(Unit(FORCE.newton, value: 1));
print(FORCE.pound_force);

Implementation

Force(
    {this.significantFigures = 10,
    this.removeTrailingZeros = true,
    this.useScientificNotation = true,
    name}) {
  this.name = name ?? PROPERTY.force;
  size = FORCE.values.length;
  Node conversionTree = Node(name: FORCE.newton, leafNodes: [
    Node(
      coefficientProduct: 1e-5,
      name: FORCE.dyne,
    ),
    Node(
      coefficientProduct: 4.4482216152605,
      name: FORCE.poundForce,
    ),
    Node(
      coefficientProduct: 9.80665,
      name: FORCE.kilogramForce,
    ),
    Node(
      coefficientProduct: 0.138254954376,
      name: FORCE.poundal,
    ),
  ]);

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