getSymbol method
Gets a localized symbol for this unit.
Implementation
String getSymbol({
required String locale,
}) {
switch (this) {
// SI.
case WeightUnit.nanogram:
return 'ng';
case WeightUnit.microgram:
return 'µg';
case WeightUnit.milligram:
return 'mg';
case WeightUnit.gram:
return 'g';
case WeightUnit.kilogram:
return 'kg';
case WeightUnit.tonne:
return 't';
case WeightUnit.megatonne:
return 'Mt';
case WeightUnit.gigatonne:
return 'Gt';
// Imperial.
case WeightUnit.ounce:
return 'oz';
case WeightUnit.pound:
return 'lb';
case WeightUnit.imperialTon:
return 'ton';
// US.
case WeightUnit.usTon:
return 'ton';
}
}