add shipments

This commit is contained in:
Sai Naw Wun
2020-10-19 05:13:49 +06:30
parent 4f8bde40b0
commit c619ae3f22
57 changed files with 1886 additions and 724 deletions

View File

@@ -28,6 +28,9 @@ class Carton {
String cartonType;
String fcsID;
String userName;
String userID;
String fcsShipmentID;
String fcsShipmentNumber;
int rate;
int weight;
@@ -36,6 +39,7 @@ class Carton {
List<String> photos;
String remark;
DateTime arrivedDate;
String cartonNumber;
List<Package> packages;
@@ -109,6 +113,7 @@ class Carton {
this.isChecked = false,
this.cartonType,
this.fcsID,
this.userID,
this.userName,
this.rate = 0,
this.weight = 0,
@@ -121,13 +126,18 @@ class Carton {
this.shipmentHistory,
this.packages,
this.cargoTypes,
this.cartonNumber,
this.fcsShipmentID,
this.fcsShipmentNumber,
this.deliveryAddress});
Map<String, dynamic> toMap() {
List _cargoTypes = cargoTypes.map((c) => c.toMap()).toList();
List _packages = packages.map((c) => c.toJson()).toList();
return {
"id": id,
'cargo_types': _cargoTypes,
'packages': _packages,
'length': length,
'width': width,
'height': height,
@@ -155,6 +165,10 @@ class Carton {
userName: map['user_name'],
fcsID: map['fcs_id'],
cartonType: map['carton_type'],
cartonNumber: map['carton_number'],
status: map['status'],
fcsShipmentID: map['fcs_shipment_id'],
fcsShipmentNumber: map['fcs_shipment_number'],
deliveryAddress: _da,
cargoTypes: cargoTypes);
}