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.
144 lines
3.6 KiB
Dart
144 lines
3.6 KiB
Dart
class SpecialServiceModel {
|
|
int? id;
|
|
String? name;
|
|
String? description;
|
|
double? price;
|
|
int? specialServiceType;
|
|
String? specialServiceTypeName;
|
|
bool? isActive;
|
|
String? startDate;
|
|
String? endDate;
|
|
List<Details>? details;
|
|
List<Office>? office;
|
|
bool? isDelivery;
|
|
bool? isSelected;
|
|
|
|
SpecialServiceModel(
|
|
{this.id,
|
|
this.name,
|
|
this.description,
|
|
this.price,
|
|
this.specialServiceType,
|
|
this.specialServiceTypeName,
|
|
this.isActive,
|
|
this.startDate,
|
|
this.endDate,
|
|
this.details,
|
|
this.office,
|
|
this.isSelected,
|
|
this.isDelivery});
|
|
|
|
SpecialServiceModel.fromJson(Map<String, dynamic> json) {
|
|
id = json['id'];
|
|
name = json['name'];
|
|
description = json['description'];
|
|
price = json['price'];
|
|
specialServiceType = json['specialServiceType'];
|
|
specialServiceTypeName = json['specialServiceTypeName'];
|
|
isActive = json['isActive'];
|
|
startDate = json['startDate'];
|
|
endDate = json['endDate'];
|
|
if (json['details'] != null) {
|
|
details = <Details>[];
|
|
json['details'].forEach((v) {
|
|
details!.add(Details.fromJson(v));
|
|
});
|
|
}
|
|
if (json['office'] != null) {
|
|
office = <Office>[];
|
|
json['office'].forEach((v) {
|
|
office!.add(Office.fromJson(v));
|
|
});
|
|
}
|
|
isDelivery = json['isDelivery'];
|
|
isSelected = false;
|
|
}
|
|
|
|
Map<String, dynamic> toJson() {
|
|
final Map<String, dynamic> data = <String, dynamic>{};
|
|
data['id'] = id;
|
|
data['name'] = name;
|
|
data['description'] = description;
|
|
data['price'] = price;
|
|
data['specialServiceType'] = specialServiceType;
|
|
data['specialServiceTypeName'] = specialServiceTypeName;
|
|
data['isActive'] = isActive;
|
|
data['startDate'] = startDate;
|
|
data['endDate'] = endDate;
|
|
if (details != null) {
|
|
data['details'] = details!.map((v) => v.toJson()).toList();
|
|
}
|
|
if (office != null) {
|
|
data['office'] = office!.map((v) => v.toJson()).toList();
|
|
}
|
|
data['isDelivery'] = isDelivery;
|
|
return data;
|
|
}
|
|
}
|
|
|
|
class Details {
|
|
int? id;
|
|
int? specialServiceID;
|
|
int? fromcity;
|
|
int? tocity;
|
|
int? price;
|
|
|
|
Details(
|
|
{this.id, this.specialServiceID, this.fromcity, this.tocity, this.price});
|
|
|
|
Details.fromJson(Map<String, dynamic> json) {
|
|
id = json['id'];
|
|
specialServiceID = json['specialServiceID'];
|
|
fromcity = json['fromcity'];
|
|
tocity = json['tocity'];
|
|
price = json['price'];
|
|
}
|
|
|
|
Map<String, dynamic> toJson() {
|
|
final Map<String, dynamic> data = <String, dynamic>{};
|
|
data['id'] = id;
|
|
data['specialServiceID'] = specialServiceID;
|
|
data['fromcity'] = fromcity;
|
|
data['tocity'] = tocity;
|
|
data['price'] = price;
|
|
return data;
|
|
}
|
|
}
|
|
|
|
class Office {
|
|
int? id;
|
|
String? officeAreaName;
|
|
String? officeAreaNameN;
|
|
int? cityID;
|
|
String? city;
|
|
int? specialServiceID;
|
|
|
|
Office(
|
|
{this.id,
|
|
this.officeAreaName,
|
|
this.officeAreaNameN,
|
|
this.cityID,
|
|
this.city,
|
|
this.specialServiceID});
|
|
|
|
Office.fromJson(Map<String, dynamic> json) {
|
|
id = json['id'];
|
|
officeAreaName = json['officeAreaName'];
|
|
officeAreaNameN = json['officeAreaNameN'];
|
|
cityID = json['cityID'];
|
|
city = json['city'];
|
|
specialServiceID = json['specialServiceID'];
|
|
}
|
|
|
|
Map<String, dynamic> toJson() {
|
|
final Map<String, dynamic> data = <String, dynamic>{};
|
|
data['id'] = id;
|
|
data['officeAreaName'] = officeAreaName;
|
|
data['officeAreaNameN'] = officeAreaNameN;
|
|
data['cityID'] = cityID;
|
|
data['city'] = city;
|
|
data['specialServiceID'] = specialServiceID;
|
|
return data;
|
|
}
|
|
}
|