fromLocale static method

Language? fromLocale(
  1. Locale locale
)

Returns a Language from the L10n.languages matching the provided locale, if any.

Implementation

static Language? fromLocale(Locale locale) {
  return L10n.languages.firstWhereOrNull((e) => e.locale == locale);
}