fix carton

This commit is contained in:
2021-01-10 15:56:27 +06:30
parent 83cea10328
commit 4839109280
21 changed files with 201 additions and 162 deletions

View File

@@ -60,6 +60,7 @@ class Carton {
//for mix box
String mixBoxType;
List<Carton> mixCartons;
List<String> mixCartonIDs;
int get amount => rate != null && weight != null ? rate * weight : 0;
@@ -172,10 +173,11 @@ class Carton {
this.cartonSizeID,
this.cartonSizeName,
this.mixBoxType,
this.mixCartons});
this.mixCartons,
this.mixCartonIDs});
Map<String, dynamic> toMap() {
List _cargoTypes = cargoTypes.map((c) => c.toMap()).toList();
List _cargoTypes = cargoTypes?.map((c) => c.toMap())?.toList() ?? [];
List _packages = packages?.map((c) => c.toJson())?.toList();
List _mixCartons = mixCartons?.map((c) => c.toJson())?.toList();
return {
@@ -246,6 +248,7 @@ class Carton {
senderID: map['sender_id'],
senderFCSID: map['sender_fcs_id'],
senderName: map['sender_name'],
mixCartonIDs: List<String>.from(map['mix_carton_ids'] ?? []),
);
}