class ServiceModel { final int? serviceProviderServiceId; final dynamic providerServiceDescription; final int? categoryId; final String? categoryName; final int? serviceId; final String? serviceDescription; final String? serviceDescriptionN; final int? serviceStatus; final dynamic statusText; final bool? isAllowAppointment; final bool? isAllowAppointmentHome; final int? customerLocationRange; final String? rangePricePerKm; final int? itemsCount; bool isExpanded; ServiceModel({ this.serviceProviderServiceId, this.providerServiceDescription, this.categoryId, this.categoryName, this.serviceId, this.serviceDescription, this.serviceDescriptionN, this.serviceStatus, this.statusText, this.isAllowAppointment, this.isAllowAppointmentHome, this.customerLocationRange, this.rangePricePerKm, this.itemsCount, required this.isExpanded, }); factory ServiceModel.fromJson(Map json) => ServiceModel( serviceProviderServiceId: json["serviceProviderServiceID"], providerServiceDescription: json["providerServiceDescription"], categoryId: json["categoryID"], categoryName: json["categoryName"], serviceId: json["serviceID"], serviceDescription: json["serviceDescription"] ?? json["serviceName"], serviceDescriptionN: json["serviceDescriptionN"]?? json["serviceNameN"], serviceStatus: json["serviceStatus"], statusText: json["statusText"], isAllowAppointment: json["isAllowAppointment"], isAllowAppointmentHome: json["isAllowAppointmentHome"], customerLocationRange: json["customerLocationRange"], rangePricePerKm: json["rangePricePerKm"].toString(), itemsCount: json["itemsCount"], isExpanded: false, ); Map toJson() => { "serviceProviderServiceID": serviceProviderServiceId, "providerServiceDescription": providerServiceDescription, "categoryID": categoryId, "categoryName": categoryName, "serviceID": serviceId, "serviceDescription": serviceDescription, "serviceDescriptionN": serviceDescriptionN, "serviceStatus": serviceStatus, "statusText": statusText, "isAllowAppointment": isAllowAppointment, "isAllowAppointmentHome": isAllowAppointmentHome, "customerLocationRange": customerLocationRange, "rangePricePerKm": rangePricePerKm, "itemsCount": itemsCount, }; }