CountryParser class

Used to parse simple string representations of countries, commonly used in databases and other forms of storage, to a Country object.

Constructors

CountryParser()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

parse(String country) Country
Returns a single country if country matches a country code or name.
parseCountryCode(String countryCode) Country
Returns a single country if it matches the given countryCode (iso2_cc).
parseCountryName(String countryName, {BuildContext? context, List<Locale>? locales}) Country
Returns a single country if it matches the given countryName.
parsePhoneCode(String phoneCode) Country
Returns a single country if it matches the given phoneCode (e164_cc).
tryParse(String country) Country?
Returns a single country if country matches a country code or name.
tryParseCountryCode(String countryCode) Country?
Returns a single country that matches the given countryCode (iso2_cc).
tryParseCountryName(String countryName, {BuildContext? context, List<Locale>? locales}) Country?
Returns a single country if it matches the given countryName.
tryParsePhoneCode(String phoneCode) Country?
Returns a single country that matches the given phoneCode (e164_cc).