2020-10-15 03:06:13 +06:30
|
|
|
class CustomDuty {
|
2021-09-10 14:27:38 +06:30
|
|
|
String? id;
|
|
|
|
|
String? productType;
|
|
|
|
|
String? desc;
|
2020-10-15 03:06:13 +06:30
|
|
|
double fee;
|
2020-12-08 20:24:15 +06:30
|
|
|
double shipmentRate;
|
|
|
|
|
CustomDuty(
|
2021-09-10 14:27:38 +06:30
|
|
|
{this.id,
|
|
|
|
|
this.productType,
|
|
|
|
|
this.desc,
|
|
|
|
|
this.fee = 0,
|
|
|
|
|
this.shipmentRate = 0});
|
2020-10-15 03:06:13 +06:30
|
|
|
|
|
|
|
|
factory CustomDuty.fromMap(Map<String, dynamic> map, String id) {
|
|
|
|
|
return CustomDuty(
|
|
|
|
|
id: id,
|
2024-01-26 16:56:20 +06:30
|
|
|
productType: map['product_type'] ?? "",
|
|
|
|
|
desc: map['desc'] ?? "",
|
2020-10-15 03:06:13 +06:30
|
|
|
fee: (map['fee'] ?? 0).toDouble(),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Map<String, dynamic> toMap() {
|
|
|
|
|
return {
|
|
|
|
|
"id": id,
|
|
|
|
|
'product_type': productType,
|
|
|
|
|
'desc': desc,
|
|
|
|
|
'fee': fee,
|
|
|
|
|
};
|
|
|
|
|
}
|
2020-10-22 04:14:53 +06:30
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
bool operator ==(Object other) => other is CustomDuty && other.id == id;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
int get hashCode => id.hashCode;
|
2020-12-08 20:24:15 +06:30
|
|
|
|
|
|
|
|
bool isChangedForEdit(CustomDuty customDuty) {
|
|
|
|
|
return customDuty.productType != this.productType ||
|
|
|
|
|
customDuty.fee != this.fee
|
|
|
|
|
// ||customDuty.shipmentRate != this.shipmentRate
|
|
|
|
|
;
|
|
|
|
|
}
|
2020-10-15 03:06:13 +06:30
|
|
|
}
|