wmoFromLocale static method

String? wmoFromLocale({
  1. Locale? locale,
})

Returns the WMO code for the given locale or if not provided, device's locale or from alpha code.

Example: (US, PO, etc.)

Implementation

static String? wmoFromLocale({Locale? locale}) {
  String? code = _resolveLocale(locale);
  Country? country =
      allCountries.firstWhereSafe((country) => country.a2 == code);
  return country?.wmo;
}