convert method
Converts a unit with a specific name (e.g. ANGLE.degree) and value to all other units
Implementation
@override
void convert(dynamic name, double? value) {
if (value == null) {
for (Unit unit in _unitList) {
unit.value = null;
unit.stringValue = null;
}
return;
}
conversionTree.convert(name, value);
for (var i = 0; i < mapSymbols.length; i++) {
_unitList[i].value =
_nodeList.singleWhere((node) => node.name == _unitList[i].name).value;
_unitList[i].stringValue = valueToString(_unitList[i].value!,
significantFigures, removeTrailingZeros, useScientificNotation);
}
}