final
This commit is contained in:
@@ -14,8 +14,8 @@ class Order {
|
||||
int id;
|
||||
int userId;
|
||||
int businessId;
|
||||
Business businessInfo;
|
||||
CartInfo cartInfo;
|
||||
Business? businessInfo;
|
||||
CartInfo? cartInfo;
|
||||
int status;
|
||||
double originPrice;
|
||||
double discountPrice;
|
||||
@@ -23,7 +23,7 @@ class Order {
|
||||
String consignee;
|
||||
String phone;
|
||||
String address;
|
||||
Address shippingAddress;
|
||||
Address? shippingAddress;
|
||||
int payMethod;
|
||||
String remark;
|
||||
String orderNum;
|
||||
@@ -33,11 +33,11 @@ class Order {
|
||||
String paymentStatus; // UNPAID, PAID, PARTIALPAID
|
||||
double amountPaid;
|
||||
List<Fulfillment> fulfillments;
|
||||
String extraData;
|
||||
String? extraData;
|
||||
bool hasComment;
|
||||
double fee;
|
||||
UserPosition shipperPosition;
|
||||
DistanceInfo deliveryDistance;
|
||||
DistanceInfo? deliveryDistance;
|
||||
|
||||
Order.fromJson(Map<String, dynamic> json)
|
||||
: id = json['id'],
|
||||
@@ -100,8 +100,10 @@ class Order {
|
||||
|
||||
double getSubtotal() {
|
||||
double subtotal = 0.0;
|
||||
for (CartLineItem lineItem in cartInfo.productList) {
|
||||
subtotal += lineItem.getTotalPrice();
|
||||
if (cartInfo != null) {
|
||||
for (CartLineItem lineItem in cartInfo!.productList!) {
|
||||
subtotal += lineItem.getTotalPrice();
|
||||
}
|
||||
}
|
||||
return subtotal;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user