convertFromTo method
Implementation
double? convertFromTo(dynamic from, dynamic to) {
assert(from.runtimeType == to.runtimeType,
'from and to must be of the same type, e.g. LENGTH');
Property? property = getPropertyFromEnum(from);
if (property == null) {
return null;
} else {
property.convert(from, toDouble());
return property.getUnit(to).value;
}
}