add carton api

This commit is contained in:
Sai Naw Wun
2020-10-20 06:19:10 +06:30
parent 453cb71fa8
commit 4d0e5b6833
15 changed files with 685 additions and 950 deletions

View File

@@ -25,6 +25,7 @@ class Carton {
double length;
int shipmentWeight;
bool isChecked;
bool isShipmentCarton;
String cartonType;
String fcsID;
String userName;
@@ -40,10 +41,12 @@ class Carton {
String remark;
DateTime arrivedDate;
String cartonNumber;
List<String> packageIDs;
List<Package> packages;
List<CargoType> cargoTypes;
List<Carton> cartons;
DeliveryAddress deliveryAddress;
@@ -129,6 +132,9 @@ class Carton {
this.cartonNumber,
this.fcsShipmentID,
this.fcsShipmentNumber,
this.cartons,
this.packageIDs,
this.isShipmentCarton = false,
this.deliveryAddress});
Map<String, dynamic> toMap() {
@@ -136,6 +142,8 @@ class Carton {
List _packages = packages?.map((c) => c.toJson())?.toList();
return {
"id": id,
'fcs_shipment_id': fcsShipmentID,
'user_id': userID,
'cargo_types': _cargoTypes,
'packages': _packages,
'length': length,
@@ -166,9 +174,12 @@ class Carton {
fcsID: map['fcs_id'],
cartonType: map['carton_type'],
cartonNumber: map['carton_number'],
status: map['status'],
userID: map['user_id'],
fcsShipmentID: map['fcs_shipment_id'],
fcsShipmentNumber: map['fcs_shipment_number'],
isShipmentCarton: map['is_shipment_carton'],
status: map['status'],
packageIDs: List<String>.from(map['package_ids'] ?? []),
deliveryAddress: _da,
cargoTypes: cargoTypes);
}