toJson method
Implementation
Map<String, dynamic> toJson() => {
"name": name,
"topLevelDomain": topLevelDomain == null
? []
: List<dynamic>.from(topLevelDomain!.map((x) => x)),
"alpha2Code": alpha2Code,
"alpha3Code": alpha3Code,
"callingCodes": callingCodes == null
? []
: List<dynamic>.from(callingCodes!.map((x) => x)),
"capital": capital,
"altSpellings": altSpellings == null
? []
: List<dynamic>.from(altSpellings!.map((x) => x)),
"subregion": subregion,
"region": region,
"population": population,
"latlng":
latlng == null ? [] : List<dynamic>.from(latlng!.map((x) => x)),
"demonym": demonym,
"area": area,
"timezones": timezones == null
? []
: List<dynamic>.from(timezones!.map((x) => x)),
"borders":
borders == null ? [] : List<dynamic>.from(borders!.map((x) => x)),
"nativeName": nativeName,
"numericCode": numericCode,
"flags": flags?.toJson(),
"currencies": currencies == null
? []
: List<dynamic>.from(currencies!.map((x) => x.toJson())),
"languages": languages == null
? []
: List<dynamic>.from(languages!.map((x) => x.toJson())),
"translations": translations?.toJson(),
"flag": flag,
"regionalBlocs": regionalBlocs == null
? []
: List<dynamic>.from(regionalBlocs!.map((x) => x.toJson())),
"cioc": cioc,
"independent": independent,
"cities": cities,
};