getByLocale static method

Localization? getByLocale(
  1. Locale locale
)

Get a localization that is equivalent to locale. If country is missing get the localization based on the code, otherwise get

Implementation

static Localization? getByLocale(Locale locale) {
  if (locale.countryCode == null) {
    return getByCode(locale.languageCode);
  } else {
    final code = locale.languageCode;
    final country = locale.countryCode;
    return localizations.firstWhereOrNull(
      (loc) => loc.code == code && loc.country == country,
    );
  }
}