Country class

Country model representing phone number metadata

Constructors

Country({required String code, required String dialCode, required String displayCC, required String flag, required String fullCountryCode, required int minLength, required int maxLength, required String name, String? regionCode, String? pattern})
const
Country.fromJson(Map<String, dynamic> json)
Create from JSON
factory

Properties

code String
ISO 3166-1 alpha-2 country code (e.g., "SO", "US")
final
dialCode String
Dial code without + prefix (e.g., "252", "1")
final
displayCC String
Display country code (can differ from dialCode for formatting)
final
flag String
Country flag emoji
final
fullCountryCode String
Full country code (typically same as dialCode)
final
hashCode int
The hash code for this object.
no setteroverride
maxLength int
Maximum valid phone number length (excluding country code)
final
minLength int
Minimum valid phone number length (excluding country code)
final
name String
Country name in English
final
pattern String?
final
regionCode String?
Optional region code for subdivisions
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

copyWith({String? dialCode, String? displayCC, String? flag, String? fullCountryCode, int? minLength, int? maxLength, String? name, String? regionCode, String? pattern}) Country
Create a copy with optional field overrides
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Convert to JSON
toString() String
A string representation of this object.
override

Operators

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