DoubleProperty<T> constructor
DoubleProperty<T> ({})
Implementation
DoubleProperty(
{required this.conversionTree,
this.mapSymbols,
dynamic name,
this.significantFigures = 10,
this.removeTrailingZeros = true,
this.useScientificNotation = true,
this.decimalSeparator = '.'}) {
assert(
decimalSeparator.isNotEmpty,
'The decimal separator cannot be empty',
);
this.name = name;
_nodeList = _getTreeAsList();
_mapNodes = {for (var node in _nodeList) node.name: node};
size = _nodeList.length;
_mapUnitsMap = {};
for (final conversionNode in _nodeList) {
final unit =
Unit(conversionNode.name, symbol: mapSymbols?[conversionNode.name]);
unit.stringValueCallback = (val) => valueToString(
val,
significantFigures,
removeTrailingZeros,
useScientificNotation,
decimalSeparator,
);
_unitList.add(unit);
_mapUnitsMap[conversionNode.name] = unit;
}
}