toJson method
Implementation
Map toJson() {
return {
"iso_3166_1_alpha2": iso_3166_1_alpha2,
"iso_3166_1_alpha3": iso_3166_1_alpha3,
"iso_3166_1_numeric": iso_3166_1_numeric,
"name": name.toJson(),
"alt_spellings": alt_spellings,
"natives": natives?.map((key, value) => MapEntry(key.iso_639_2_alpha3, value)),
"translations": translations?.map((key, value) => MapEntry(key.iso_639_2_alpha3, value)),
"emoji": emoji,
"emojiU": emojiU,
"cioc": cioc,
"status": status,
"capital": capital,
"tld": tld,
"unMember": unMember,
"timezones": timezones,
"demonyms": demonyms,
"currencies":
currencies == null ? null : List<String>.from(currencies!.map((e) => e.iso_4217_code)),
"dialling": dialling?.toJson(),
"geographical": geographical?.toJson(),
"languages": List<String>.from(languages!.map((e) => e.iso_639_2_alpha3)),
"population": population?.toJson(),
"extra": extra?.toJson(),
"wikiLink": wikiLink,
"vat_rates": vat_rates,
"states": provinces?.map((e) => e.toJson()).toList(),
};
}