import 'package:job_app/models/Country/city.dart'; class StateModel{ int id; String name; String state_code; String latitude; String longitude; String type; Listcities; StateModel( {this.id, this.name, this.state_code, this.latitude, this.longitude, this.type, this.cities}); factory StateModel.fromJson(Map json) => StateModel( id: json["id"], name: json["name"], state_code: json["state_code"], latitude: json["latitude"], longitude: json["longitude"], type: json["type"], cities: List.from(json["cities"].map((e)=>CityModel.fromJson(e))), ); Map toJson()=>{ "id":id, "name":name, "state_code":state_code, "latitude":latitude, "longitude":longitude, "type":type, "cities":cities, }; }