// To parse this JSON data, do // // final cities = citiesFromJson(jsonString); import 'dart:convert'; Cities citiesFromJson(String str) => Cities.fromJson(json.decode(str)); String citiesToJson(Cities data) => json.encode(data.toJson()); class Cities { Cities({ this.totalItemsCount, this.data, this.messageStatus, this.message, }); int? totalItemsCount; List? data; int? messageStatus; String? message; factory Cities.fromJson(Map json) => Cities( totalItemsCount: json["totalItemsCount"] == null ? null : json["totalItemsCount"], data: json["data"] == null ? null : List.from(json["data"].map((x) => CityData.fromJson(x))), messageStatus: json["messageStatus"] == null ? null : json["messageStatus"], message: json["message"] == null ? null : json["message"], ); Map toJson() => { "totalItemsCount": totalItemsCount == null ? null : totalItemsCount, "data": data == null ? null : List.from(data!.map((x) => x.toJson())), "messageStatus": messageStatus == null ? null : messageStatus, "message": message == null ? null : message, }; } class CityData { CityData({ this.id, this.cityName, this.cityNameN, this.countryId, }); int? id; String? cityName; String? cityNameN; int? countryId; factory CityData.fromJson(Map json) => CityData( id: json["id"] == null ? null : json["id"], cityName: json["cityName"] == null ? null : json["cityName"], cityNameN: json["cityNameN"] == null ? null : json["cityNameN"], countryId: json["countryID"] == null ? null : json["countryID"], ); Map toJson() => { "id": id == null ? null : id, "cityName": cityName == null ? null : cityName, "cityNameN": cityNameN == null ? null : cityNameN, "countryID": countryId == null ? null : countryId, }; }