import 'package:job_app/models/Country/city.dart'; import 'package:job_app/models/Country/state.dart'; import 'package:job_app/models/Country/timezone.dart'; import 'package:job_app/models/Country/translations.dart'; class CountryModel { int id; String name; String iso3; String iso2; String numeric_code; String phone_code; String capital; String currency; String currency_symbol; String tld; String natives; String region; String subregion; TranslationsModel translations; String latitude; String longitude; String emoji; String emojiU; CountryModel( {this.id, this.name, this.iso3, this.iso2, this.numeric_code, this.phone_code, this.capital, this.currency, this.currency_symbol, this.tld, this.natives, this.region, this.subregion, this.translations, this.latitude, this.longitude, this.emoji, this.emojiU}); factory CountryModel.fromJson(Map json) => CountryModel( id: json["id"], name: json["name"], iso3: json["iso3"], iso2: json["iso2"], numeric_code: json["numeric_code"], phone_code: json["phone_code"], capital: json["capital"], currency: json["currency"], currency_symbol: json["currency_symbol"], tld: json["tld"], natives: json["natives"], region: json["region"], subregion: json["subregion"], translations: TranslationsModel.fromJson(json["translations"]), latitude: json["latitude"], longitude: json["longitude"], emoji: json["emoji"], emojiU: json["emojiU"], ); Map toJson() => { "id": id, "name": name, "iso3": iso3, "iso2": iso2, "numeric_code": numeric_code, "phone_code": phone_code, "capital": capital, "currency": currency, "currency_symbol": currency_symbol, "tld": tld, "natives": natives, "region": region, "subregion": subregion, "translations": translations.toJson(), "latitude": latitude, "longitude": longitude, "emoji": emoji, "emojiU": emojiU, }; }