Description
Add here a brief explanation to which units should be added and possibly why (e.g. they are often used in a specific job). We know that there are a ton of unit of measurement that are not yet added to this app. We want to have just the most used one.
enum TEMPERATURE {
fahrenheit,
celsius,
kelvin,
reamur,
romer,
delisle,
rankine,
}
extension TemperatureExtension on TEMPERATURE {
String get symbol {
switch (this) {
case TEMPERATURE.fahrenheit:
return '°F';
case TEMPERATURE.celsius:
return '°C';
case TEMPERATURE.kelvin:
return 'K';
case TEMPERATURE.reamur:
return '°Re';
case TEMPERATURE.romer:
return '°Rø';
case TEMPERATURE.delisle:
return '°De';
case TEMPERATURE.rankine:
return '°R';
default:
return '';
}
}
}
this can make code become much simple , you can directly do "Temperature. fahrenheit.symbol"
thanks , nice work