Country class

Represents a country with its relevant information.

Constructors

Country({required String phoneCode, required String countryCode, required int e164Sc, required bool geographic, required int level, required String name, String? nameLocalized = '', required String example, required String displayName, required String displayNameNoCountryCode, required String e164Key, String? fullExampleWithPlusSign, required String? capital, required String? language, Map? currency, List? popularSports, String? callingCode, String? timeZone, String? region, String? subregion, String? resident, String? internetTld, String? flagEmojiText})
Constructs a Country object.
Country.from({required Map<String, dynamic> json})
Constructs a Country object from JSON data.

Properties

callingCode String?
final
capital String?
final
countryCode String
final
currency Map?
final
displayName String
final
displayNameNoCountryCode String
final
e164Key String
final
e164Sc int
final
example String
final
flagEmoji String
Retrieves the flag emoji of the country.
no setter
flagEmojiText String?
final
fullExampleWithPlusSign String?
final
geographic bool
final
hashCode int
The hash code for this object.
no setteroverride
internetTld String?
final
iswWorldWide bool
Checks if the country represents the global entity.
no setter
language String?
final
level int
final
name String
final
nameLocalized String?
getter/setter pair
phoneCode String
final
popularSports List?
final
region String?
final
resident String?
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
subregion String?
final
timeZone String?
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
startsWith(String query, CountryLocalizations? localizations) bool
Checks if a string query matches the country's information.
toJson() Map<String, dynamic>
Converts the Country object to a JSON map.
toString() String
A string representation of this object.
override

Operators

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

Static Properties

globalProvider Country
The global provider for country data.
getter/setter pair

Static Methods

parse(String country) Country
Parses a country code and returns a Country object.
tryParse(String country) Country?
Tries to parse a country code and returns a Country object if successful, otherwise returns null.