CityModel.fromJson constructor
CityModel.fromJson(
- dynamic jsonRes
Implementation
CityModel.fromJson(jsonRes) {
value = jsonRes["value"];
areaCode = jsonRes["areaCode"];
parentId = jsonRes["parentId"];
label = jsonRes["label"];
center = jsonRes["center"];
List items = jsonRes["children"] ?? [];
children = [];
for (var listItem in items) {
children.add(CityModel.fromJson(listItem));
}
}