update carton and fcs shipment
This commit is contained in:
@@ -74,17 +74,20 @@ class Package {
|
||||
this.cartonIds = const []});
|
||||
|
||||
factory Package.fromMap(Map<String, dynamic> map, String docID) {
|
||||
var _currentStatusDate = (map['status_date'] as Timestamp);
|
||||
var currentStatusDate =
|
||||
map['status_date'] != null ? (map['status_date'] as Timestamp) : null;
|
||||
|
||||
List<ShipmentStatus> _shipmentStatus = List.from(map['all_status'])
|
||||
List<ShipmentStatus> shipmentStatus = List.from(map['all_status'])
|
||||
.map((e) => ShipmentStatus.fromMap(Map<String, dynamic>.from(e)))
|
||||
.toList();
|
||||
List<String> _photoUrls =
|
||||
List<String> photoUrls =
|
||||
map['photo_urls'] == null ? [] : List.from(map['photo_urls']);
|
||||
var da = map['delivery_address'];
|
||||
var _da = da != null ? DeliveryAddress.fromMap(da, da["id"]) : null;
|
||||
var deliveryAddress = map['delivery_address'];
|
||||
var da = deliveryAddress != null
|
||||
? DeliveryAddress.fromMap(deliveryAddress, deliveryAddress["id"])
|
||||
: null;
|
||||
|
||||
List<String> cartonIds =
|
||||
List<String> cartonIds =
|
||||
map['carton_ids'] == null ? [] : List.from(map['carton_ids']);
|
||||
|
||||
return Package(
|
||||
@@ -101,10 +104,10 @@ class Package {
|
||||
senderFCSID: map['sender_fcs_id'],
|
||||
senderName: map['sender_name'],
|
||||
senderPhoneNumber: map['sender_phone_number'],
|
||||
deliveryAddress: _da,
|
||||
currentStatusDate: _currentStatusDate.toDate().toLocal(),
|
||||
photoUrls: _photoUrls,
|
||||
shipmentHistory: _shipmentStatus,
|
||||
deliveryAddress: da,
|
||||
currentStatusDate: currentStatusDate?.toDate().toLocal(),
|
||||
photoUrls: photoUrls,
|
||||
shipmentHistory: shipmentStatus,
|
||||
cartonIds: cartonIds);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user