Country class

Represents a country with comprehensive metadata and information.

This class contains all relevant information about a country including its geographical location, languages, currencies, contact information, and administrative details.

Example usage:

Country brazil = Country(
  name: 'Brazil',
  isoCode: 'BR',
  continent: southAmerica,
  languages: [portuguese],
  currencies: [real],
  dialCode: '+55',
  // ... other properties
);

Constructors

Country.new({required String isoCode, required String name, required Continent continent, required List<Language> languages, required List<Currency> currencies, required String dialCode, required String phonePattern, required String zipCodePattern, List<String> timezones = const [], required String flagAssetPath})
Creates a new Country instance.

Properties

continent Continent
The continent where the country is geographically located.
final
currencies List<Currency>
The list of official currencies used in the country. Some countries may have multiple currencies.
final
dialCode String
The international dialing code used for phone calls (e.g., '+55', '+1'). Also known as country calling code.
final
flagAssetPath String
The asset path to the country's flag image (SVG format). Used for displaying the flag in the UI.
final
hashCode int
The hash code for this object.
no setteroverride
isoCode String
The ISO 3166-1 alpha-2 country code (e.g., 'BR', 'US'). This is a standardized two-letter code used internationally.
final
languages List<Language>
The list of official languages spoken in the country. Multiple languages indicate multilingual countries.
final
name String
The official name of the country (e.g., 'Brazil', 'United States').
final
phonePattern String
A regex pattern for validating phone numbers in this country. Used for input validation and formatting.
final
primaryCurrency Currency?
Returns the primary currency (first in the list) or null if none exist.
no setter
primaryLanguage Language?
Returns the primary language (first in the list) or null if none exist.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
timezones List<String>
The list of IANA timezone identifiers used in the country. Countries spanning multiple time zones will have multiple entries.
final
zipCodePattern String
A regex pattern for validating postal/ZIP codes in this country. Empty string indicates no standardized postal code system.
final

Methods

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

Operators

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