CountryCodes class
Properties
hashCode
→ int
The hash code for this object.
no setter inherited
runtimeType
→ Type
A representation of the runtime type of the object.
no setter inherited
Methods
noSuchMethod (Invocation invocation )
→ dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString ()
→ String
A string representation of this object.
inherited
Static Methods
alpha2Code ([Locale ? locale ])
→ String ?
Returns the ISO 3166-1 alpha2Code for the given locale.
If not provided, device's locale will be used instead.
You can read more about ISO 3166-1 codes here
countryCodes ()
→ List <CountryDetails >
A list of country data for every country
detailsForLocale ([Locale ? locale ])
→ CountryDetails
Returns the CountryDetails for the given locale. If details cannot be
resolved, throws a StateError . Use detailsForLocaleOrNull for null-safe
lookup.
detailsForLocaleOrNull ([Locale ? locale ])
→ CountryDetails ?
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
detailsFromAlpha2 (String alpha2 )
→ CountryDetails
Returns the CountryDetails for the given country alpha2 code.
dialCode ([Locale ? locale ])
→ String ?
Returns the dialCode for the given locale or device's locale, if not provided.
dialNumbers ()
→ List <String ? >
A list of dial codes for every country
getDeviceLocale ()
→ Locale ?
Returns the current device's Locale
Eg. Locale('en','US')
init ([Locale ? appLocale ])
→ Future <bool >
Inits the underlying plugin channel and fetch current's device locale to be ready
to use synchronously when required.
name ({Locale ? locale , VoidCallback ? onInvalidLocale })
→ String ?
Returns the exended name for the given locale or if not provided, device's locale.
subdivisionFromCode (String subdivisionCode )
→ CountrySubdivision ?
Returns subdivision details for an ISO 3166-2 subdivision code.
Example: SK-BL, CZ-10.
subdivisions ()
→ List <CountrySubdivision >
Returns all available subdivisions across supported countries.
subdivisionsForCountry (String alpha2 )
→ List <CountrySubdivision >
Returns a list of subdivisions for the given country alpha-2 code.
Codes follow ISO 3166-2 format (e.g. SK-BL, CZ-10).