Country.fromJson constructor
Country.fromJson(
- Map<String, dynamic> json
)
Implementation
factory Country.fromJson(Map<String, dynamic> json) => Country(
name: json["name"],
topLevelDomain: json["topLevelDomain"] == null
? []
: List<String>.from(json["topLevelDomain"]!.map((x) => x)),
alpha2Code: json["alpha2Code"],
alpha3Code: json["alpha3Code"],
callingCodes: json["callingCodes"] == null
? []
: List<String>.from(json["callingCodes"]!.map((x) => x)),
capital: json["capital"],
altSpellings: json["altSpellings"] == null
? []
: List<String>.from(json["altSpellings"]!.map((x) => x)),
subregion: json["subregion"],
region: json["region"],
population: json["population"],
latlng: json["latlng"] == null
? []
: List<int>.from(json["latlng"]!.map((x) => x)),
demonym: json["demonym"],
area: json["area"],
timezones: json["timezones"] == null
? []
: List<String>.from(json["timezones"]!.map((x) => x)),
borders: json["borders"] == null
? []
: List<String>.from(json["borders"]!.map((x) => x)),
nativeName: json["nativeName"],
numericCode: json["numericCode"],
flags: json["flags"] == null ? null : Flags.fromJson(json["flags"]),
currencies: json["currencies"] == null
? []
: List<Currency>.from(
json["currencies"]!.map((x) => Currency.fromJson(x))),
languages: json["languages"] == null
? []
: List<Language>.from(
json["languages"]!.map((x) => Language.fromJson(x))),
translations: json["translations"] == null
? null
: Translations.fromJson(json["translations"]),
flag: json["flag"],
regionalBlocs: json["regionalBlocs"] == null
? []
: List<RegionalBloc>.from(
json["regionalBlocs"]!.map((x) => RegionalBloc.fromJson(x))),
cioc: json["cioc"],
independent: json["independent"],
cities: json["cities"],
);