prepare carton image upload page and carton info page

This commit is contained in:
sma
2024-02-08 17:01:32 +06:30
parent 00011ad5d6
commit 0530d401f4
3 changed files with 342 additions and 509 deletions

View File

@@ -37,6 +37,7 @@ class Carton {
String? cartonSizeID;
String? cartonSizeName;
double cartonWeight;
String? billToValue;
bool isSelected;
int rate;
@@ -44,6 +45,7 @@ class Carton {
String? packageType;
String? pickUpID;
List<String> photos = [];
List<String> photoUrls;
String? remark;
DateTime? arrivedDate;
String? cartonNumber;
@@ -147,6 +149,7 @@ class Carton {
this.packages = const [],
this.cargoTypes = const [],
this.cartonNumber,
this.billToValue,
this.fcsShipmentID,
this.fcsShipmentNumber,
this.packageIDs = const [],
@@ -160,6 +163,7 @@ class Carton {
this.mixCartons = const [],
this.mixCartonIDs = const [],
this.cartonWeight =0,
this.photoUrls = const [],
this.isSelected = false});
Map<String, dynamic> toMap() {
@@ -199,6 +203,8 @@ class Carton {
List<Map<String, dynamic>>.from(map['mix_cartons'] ?? []);
var _mixCartons =
mixCartonsMaps.map((e) => Carton.fromMap(e, e["id"])).toList();
List<String> _photoUrls =
map['photo_urls'] == null ? [] : List.from(map['photo_urls']);
return Carton(
id: docID,
@@ -231,6 +237,7 @@ class Carton {
senderName: map['sender_name'],
mixCartonIDs: List<String>.from(map['mix_carton_ids'] ?? []),
cartonWeight: (map['carton_weight'] ?? 0).toDouble(),
photoUrls: _photoUrls,
);
}
@@ -254,7 +261,8 @@ class Carton {
'mix_cartons': _mixCartons,
'sender_id': senderID,
'sender_fcs_id': senderFCSID,
'sender_name': senderName
'sender_name': senderName,
"photo_urls": photoUrls
};
}