CityModel.fromJson constructor

CityModel.fromJson(
  1. 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));
  }
}