add carton editor for package
This commit is contained in:
@@ -133,3 +133,7 @@ const invoice_paid_status = "paid";
|
||||
const payment_pending_status = "pending";
|
||||
const payment_confirmed_status = "confirmed";
|
||||
const payment_canceled_status = "canceled";
|
||||
|
||||
//Delivery types
|
||||
const delivery_caton = "Delivery carton";
|
||||
const pickup_carton = "Pick-up carton";
|
||||
|
||||
@@ -14,6 +14,7 @@ class Package {
|
||||
DateTime? currentStatusDate;
|
||||
List<String> photoUrls;
|
||||
List<ShipmentStatus> shipmentHistory;
|
||||
List<String> cartonIds;
|
||||
String? desc;
|
||||
|
||||
String? status;
|
||||
@@ -69,7 +70,8 @@ class Package {
|
||||
this.deliveryAddress,
|
||||
this.isChecked = false,
|
||||
this.photoFiles = const [],
|
||||
this.senderPhoneNumber});
|
||||
this.senderPhoneNumber,
|
||||
this.cartonIds = const []});
|
||||
|
||||
factory Package.fromMap(Map<String, dynamic> map, String docID) {
|
||||
var _currentStatusDate = (map['status_date'] as Timestamp);
|
||||
@@ -82,6 +84,9 @@ class Package {
|
||||
var da = map['delivery_address'];
|
||||
var _da = da != null ? DeliveryAddress.fromMap(da, da["id"]) : null;
|
||||
|
||||
List<String> cartonIds =
|
||||
map['carton_ids'] == null ? [] : List.from(map['carton_ids']);
|
||||
|
||||
return Package(
|
||||
id: docID,
|
||||
userID: map['user_id'],
|
||||
@@ -99,7 +104,8 @@ class Package {
|
||||
deliveryAddress: _da,
|
||||
currentStatusDate: _currentStatusDate.toDate().toLocal(),
|
||||
photoUrls: _photoUrls,
|
||||
shipmentHistory: _shipmentStatus);
|
||||
shipmentHistory: _shipmentStatus,
|
||||
cartonIds: cartonIds);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
|
||||
Reference in New Issue
Block a user