findByAbbreviation method

Option findByAbbreviation (String abbr)

Finds the option whose abbreviation is abbr, or null if no option has that abbreviation.

Implementation

Option findByAbbreviation(String abbr) {
  return options.values
      .firstWhere((option) => option.abbr == abbr, orElse: () => null);
}