You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
car_common_app/lib/models/services/service_model.dart

61 lines
2.0 KiB
Dart

//TODO: this needs to match with ServiceProviderService from backend side
class ServiceModel {
final int? providerBranchServiceId;
final dynamic providerServiceDescription;
final int? serviceCategoryId;
final int? serviceId;
final String? serviceDescription;
final String? serviceDescriptionN;
final int? status;
final dynamic statusText;
final bool? isAllowAppointment;
final int? customerLocationRange;
final int? itemsCount;
bool isExpanded;
ServiceModel({
this.providerBranchServiceId,
this.providerServiceDescription,
this.serviceCategoryId,
this.serviceId,
this.serviceDescription,
this.serviceDescriptionN,
this.status,
this.statusText,
this.isAllowAppointment,
this.customerLocationRange,
this.itemsCount,
required this.isExpanded,
});
factory ServiceModel.fromJson(Map<String, dynamic> json) =>
ServiceModel(
providerBranchServiceId: json["providerBranchServiceID"],
providerServiceDescription: json["providerServiceDescription"],
serviceCategoryId: json["serviceCategoryID"],
serviceId: json["serviceID"],
serviceDescription: json["serviceDescription"],
serviceDescriptionN: json["serviceDescriptionN"],
status: json["status"],
statusText: json["statusText"],
isAllowAppointment: json["isAllowAppointment"],
customerLocationRange: json["customerLocationRange"],
itemsCount: json["itemsCount"],
isExpanded: false,
);
Map<String, dynamic> toJson() =>
{
"providerBranchServiceID": providerBranchServiceId,
"providerServiceDescription": providerServiceDescription,
"serviceCategoryID": serviceCategoryId,
"serviceID": serviceId,
"serviceDescription": serviceDescription,
"serviceDescriptionN": serviceDescriptionN,
"status": status,
"statusText": statusText,
"isAllowAppointment": isAllowAppointment,
"customerLocationRange": customerLocationRange,
"itemsCount": itemsCount,
};
}