// To parse this JSON data, do // // final services = servicesFromJson(jsonString); import 'dart:convert'; Services servicesFromJson(String str) => Services.fromJson(json.decode(str)); String servicesToJson(Services data) => json.encode(data.toJson()); class Services { Services({ this.totalItemsCount, this.data, this.messageStatus, this.message, }); int? totalItemsCount; List? data; int? messageStatus; String? message; factory Services.fromJson(Map json) => Services( totalItemsCount: json["totalItemsCount"] == null ? null : json["totalItemsCount"], data: json["data"] == null ? null : List.from(json["data"].map((x) => ServicesData.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 ServicesData { ServicesData({ this.id, this.description, this.descriptionN, this.serviceIconUrl, this.serviceImageUrl, this.serviceCategoryId, this.categoryName, this.isSelected, }); int? id; String? description; String? descriptionN; dynamic? serviceIconUrl; dynamic? serviceImageUrl; int? serviceCategoryId; dynamic? categoryName; bool? isSelected; factory ServicesData.fromJson(Map json) => ServicesData( id: json["id"] == null ? null : json["id"], description: json["description"] == null ? (json["serviceDescription"] == null ? null : json["serviceDescription"]) : json["description"], descriptionN: json["descriptionN"] == null ? (json["serviceDescriptionN"] == null ? null : json["serviceDescriptionN"]) : json["descriptionN"], serviceIconUrl: json["serviceIconUrl"] == null ? null : json["serviceIconUrl"], serviceImageUrl: json["serviceImageUrl"] == null ? null : json["serviceImageUrl"], serviceCategoryId: json["serviceCategoryID"] == null ? null : json["serviceCategoryID"], categoryName: json["categoryName"] == null ? null : json["categoryName"], isSelected: false, ); Map toJson() => { "id": id == null ? null : id, "description": description == null ? null : description, "descriptionN": descriptionN == null ? null : descriptionN, "serviceIconUrl": serviceIconUrl, "serviceImageUrl": serviceImageUrl, "serviceCategoryID": serviceCategoryId == null ? null : serviceCategoryId, "categoryName": categoryName, }; }