Provides a way to format length measurements in a human readable way. Based on currently selected region and scale.
There are two main methods: convertLength and formatLength.
Returns string with value and unit based on current region and potentially value scale. For example 5000 metres becomes 3.11mi.
Returns string with value and unit. For example 500 kilometres becomes 500km
_formattingResult =
await FlutterMeasureFormatter().formatLength(_selectedUnit, 500);
_conversionResult =
await FlutterMeasureFormatter().convertLength(_selectedUnit, 500);
Available units are defined in FlutterMeasureFormatterUnit
.
- Android scaling is very limited and hardcoded for now.
- There is no web implementation, looking for viable solutions.