// 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"], data: json["data"] == null ? null : List.from(json["data"].map((x) => ServicesData.fromJson(x))), messageStatus: json["messageStatus"], message: json["message"], ); Map toJson() => { "totalItemsCount": totalItemsCount, "data": data == null ? null : List.from(data!.map((x) => x.toJson())), "messageStatus": messageStatus, "message": 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; dynamic? serviceCategoryId; dynamic? categoryName; bool? isSelected; factory ServicesData.fromJson(Map json) => ServicesData( id: json["id"], description: json["description"] ?? (json["serviceDescription"]), descriptionN: json["descriptionN"] ?? (json["serviceDescriptionN"]), serviceIconUrl: json["serviceIconUrl"], serviceImageUrl: json["serviceImageUrl"], serviceCategoryId: json["serviceCategoryID"], categoryName: json["categoryName"], isSelected: false, ); Map toJson() => { "id": id, "description": description, "descriptionN": descriptionN, "serviceIconUrl": serviceIconUrl, "serviceImageUrl": serviceImageUrl, "serviceCategoryID": serviceCategoryId, "categoryName": categoryName, }; }