detailsForLocale static method

CountryDetails detailsForLocale([
  1. Locale? locale
])

Returns the CountryDetails for the given locale. If not provided, the device's locale will be used instead. Have in mind that this is different than specifying supportedLocales on your app. Exposed properties are the name, alpha2Code, alpha3Code and dialCode

Example:

"name": "United States",
"alpha2Code": "US",
"dial_code": "+1",

Implementation

static CountryDetails detailsForLocale([Locale? locale]) {
  String? code = _resolveLocale(locale);
  return CountryDetails.fromMap(codes[code!], _localizedCountryNames[code]);
}