CountryParser class Null safety

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.
read-onlyinherited
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent 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.
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.