Country class

Represents a country with its code and name.

Used in address forms, shipping configurations, and location-based features. Follows ISO 3166-1 alpha-2 country code standard.

Annotations

Constructors

Country({required String code, required String name, String? code3, String? numericCode, String? phoneCode, String? currencyCode, String? currencySymbol, bool isShippingAvailable = true, bool isBillingAvailable = true, List<CountryState>? states, Map<String, dynamic>? extensions})
const
Country.fromJson(Map<String, dynamic> json)
factory

Properties

code String
ISO 3166-1 alpha-2 country code (e.g., 'US', 'GB', 'CA')
final
code3 String?
ISO 3166-1 alpha-3 country code (e.g., 'USA', 'GBR', 'CAN')
final
currencyCode String?
Currency code (e.g., 'USD', 'GBP', 'EUR')
final
currencySymbol String?
Currency symbol (e.g., '$', '£', '€')
final
extensions Map<String, dynamic>?
finalinherited
hashCode int
The hash code for this object.
no setterinherited
isBillingAvailable bool
Whether this country is available for billing
final
isShippingAvailable bool
Whether this country is available for shipping
final
name String
Full country name (e.g., 'United States', 'United Kingdom', 'Canada')
final
numericCode String?
Numeric country code (e.g., '840' for US, '826' for GB)
final
phoneCode String?
Phone calling code (e.g., '+1', '+44', '+91')
final
props List<Object?>
The list of properties that will be used to determine whether two instances are equal.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
states List<CountryState>?
List of states/provinces/regions in this country
final
stringify bool?
If set to true, the toString method will be overridden to output this instance's props.
no setterinherited

Methods

copyWith({String? code, String? name, String? code3, String? numericCode, String? phoneCode, String? currencyCode, String? currencySymbol, bool? isShippingAvailable, bool? isBillingAvailable, List<CountryState>? states, Map<String, dynamic>? extensions}) Country
getExtension<T>(String key) → T?
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
toString() String
A string representation of this object.
inherited

Operators

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