|
|
|
|
@ -1,6 +1,42 @@
|
|
|
|
|
// To parse this JSON data, do
|
|
|
|
|
//
|
|
|
|
|
// final itemModel = itemModelFromJson(jsonString);
|
|
|
|
|
|
|
|
|
|
import 'dart:convert';
|
|
|
|
|
|
|
|
|
|
class ServiceItemModel {
|
|
|
|
|
ItemModel itemModelFromJson(String str) => ItemModel.fromJson(json.decode(str));
|
|
|
|
|
|
|
|
|
|
String itemModelToJson(ItemModel data) => json.encode(data.toJson());
|
|
|
|
|
|
|
|
|
|
class ItemModel {
|
|
|
|
|
final int? messageStatus;
|
|
|
|
|
final int? totalItemsCount;
|
|
|
|
|
final List<ItemData>? data;
|
|
|
|
|
final String? message;
|
|
|
|
|
|
|
|
|
|
ItemModel({
|
|
|
|
|
this.messageStatus,
|
|
|
|
|
this.totalItemsCount,
|
|
|
|
|
this.data,
|
|
|
|
|
this.message,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
factory ItemModel.fromJson(Map<String, dynamic> json) => ItemModel(
|
|
|
|
|
messageStatus: json["messageStatus"],
|
|
|
|
|
totalItemsCount: json["totalItemsCount"],
|
|
|
|
|
data: json["data"] == null ? [] : List<ItemData>.from(json["data"]!.map((x) => ItemData.fromJson(x))),
|
|
|
|
|
message: json["message"],
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
Map<String, dynamic> toJson() => {
|
|
|
|
|
"messageStatus": messageStatus,
|
|
|
|
|
"totalItemsCount": totalItemsCount,
|
|
|
|
|
"data": data == null ? [] : List<dynamic>.from(data!.map((x) => x.toJson())),
|
|
|
|
|
"message": message,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class ItemData {
|
|
|
|
|
final int? id;
|
|
|
|
|
final String? name;
|
|
|
|
|
final String? price;
|
|
|
|
|
@ -15,7 +51,7 @@ class ServiceItemModel {
|
|
|
|
|
final bool? isAppointmentCustomerLoc;
|
|
|
|
|
bool? isUpdateOrSelected;
|
|
|
|
|
|
|
|
|
|
ServiceItemModel({
|
|
|
|
|
ItemData({
|
|
|
|
|
this.id,
|
|
|
|
|
this.name,
|
|
|
|
|
this.price,
|
|
|
|
|
@ -31,34 +67,34 @@ class ServiceItemModel {
|
|
|
|
|
this.isUpdateOrSelected,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
factory ServiceItemModel.fromJson(Map<String, dynamic> json) => ServiceItemModel(
|
|
|
|
|
id: json["id"],
|
|
|
|
|
name: json["name"],
|
|
|
|
|
price: json["price"].toString(),
|
|
|
|
|
manufactureDate: json["manufactureDate"],
|
|
|
|
|
description: json["description"],
|
|
|
|
|
pictureUrl: json["pictureUrl"],
|
|
|
|
|
companyId: json["companyID"],
|
|
|
|
|
serviceProviderServiceId: json["serviceProviderServiceID"],
|
|
|
|
|
isActive: json["isActive"],
|
|
|
|
|
isAllowAppointment: json["isAllowAppointment"],
|
|
|
|
|
isAppointmentCompanyLoc: json["isAppointmentCompanyLoc"],
|
|
|
|
|
isAppointmentCustomerLoc: json["isAppointmentCustomerLoc"],
|
|
|
|
|
factory ItemData.fromJson(Map<String, dynamic> json) => ItemData(
|
|
|
|
|
id: json["id"],
|
|
|
|
|
name: json["name"],
|
|
|
|
|
price: json["price"].toString(),
|
|
|
|
|
manufactureDate: json["manufactureDate"],
|
|
|
|
|
description: json["description"],
|
|
|
|
|
pictureUrl: json["pictureUrl"],
|
|
|
|
|
companyId: json["companyID"],
|
|
|
|
|
serviceProviderServiceId: json["serviceProviderServiceID"],
|
|
|
|
|
isActive: json["isActive"],
|
|
|
|
|
isAllowAppointment: json["isAllowAppointment"],
|
|
|
|
|
isAppointmentCompanyLoc: json["isAppointmentCompanyLoc"],
|
|
|
|
|
isAppointmentCustomerLoc: json["isAppointmentCustomerLoc"],
|
|
|
|
|
isUpdateOrSelected: false,
|
|
|
|
|
);
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
Map<String, dynamic> toJson() => {
|
|
|
|
|
"id": id,
|
|
|
|
|
"name": name,
|
|
|
|
|
"price": price,
|
|
|
|
|
"manufactureDate": manufactureDate,
|
|
|
|
|
"description": description,
|
|
|
|
|
"pictureUrl": pictureUrl,
|
|
|
|
|
"companyID": companyId,
|
|
|
|
|
"serviceProviderServiceID": serviceProviderServiceId,
|
|
|
|
|
"isActive": isActive,
|
|
|
|
|
"isAllowAppointment": isAllowAppointment,
|
|
|
|
|
"isAppointmentCompanyLoc": isAppointmentCompanyLoc,
|
|
|
|
|
"isAppointmentCustomerLoc": isAppointmentCustomerLoc,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
"id": id,
|
|
|
|
|
"name": name,
|
|
|
|
|
"price": price,
|
|
|
|
|
"manufactureDate": manufactureDate,
|
|
|
|
|
"description": description,
|
|
|
|
|
"pictureUrl": pictureUrl,
|
|
|
|
|
"companyID": companyId,
|
|
|
|
|
"serviceProviderServiceID": serviceProviderServiceId,
|
|
|
|
|
"isActive": isActive,
|
|
|
|
|
"isAllowAppointment": isAllowAppointment,
|
|
|
|
|
"isAppointmentCompanyLoc": isAppointmentCompanyLoc,
|
|
|
|
|
"isAppointmentCustomerLoc": isAppointmentCustomerLoc,
|
|
|
|
|
};
|
|
|
|
|
}
|