getShortestName method

String getShortestName(
  1. bool sing
)

Returns the shortest name for the units. This will be the first non-null name found when inspecting secondary abbreviation, primary abbreviation and full name, in that order. If sing is true and no symbol or alternate name are available then the singular version of the name will be returned.

Implementation

String getShortestName(bool sing) =>
    abbrev2 ?? abbrev1 ?? (sing ? (singular ?? name) : name);