fix carton
This commit is contained in:
@@ -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'] ?? []),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ class DeliveryAddress {
|
||||
String state;
|
||||
String phoneNumber;
|
||||
bool isDefault;
|
||||
String userID;
|
||||
DeliveryAddress(
|
||||
{this.id,
|
||||
this.fullName,
|
||||
@@ -15,6 +16,7 @@ class DeliveryAddress {
|
||||
this.city,
|
||||
this.state,
|
||||
this.phoneNumber,
|
||||
this.userID,
|
||||
this.isDefault = false});
|
||||
|
||||
factory DeliveryAddress.fromMap(Map<String, dynamic> map, String docID) {
|
||||
@@ -39,6 +41,7 @@ class DeliveryAddress {
|
||||
'city': city,
|
||||
'state': state,
|
||||
'phone_number': phoneNumber,
|
||||
'user_id': userID,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user