fixed order details

merge-requests/277/head
Fatimah Alshammari 4 years ago
parent 747763c4be
commit 8624d695dc

@ -10,13 +10,13 @@ class Reviews {
bool isApproved;
String title;
String reviewText;
Null replyText;
String replyText;
int rating;
int helpfulYesTotal;
int helpfulNoTotal;
String createdOnUtc;
Customer customer;
Null product;
//Null product;
Reviews(
{this.id,
@ -34,7 +34,8 @@ class Reviews {
this.helpfulNoTotal,
this.createdOnUtc,
this.customer,
this.product});
// this.product
});
Reviews.fromJson(Map<String, dynamic> json) {
id = json['id'];
@ -54,7 +55,7 @@ class Reviews {
customer = json['customer'] != null
? new Customer.fromJson(json['customer'])
: null;
product = json['product'];
// product = json['product'];
}
Map<String, dynamic> toJson() {
@ -76,7 +77,7 @@ class Reviews {
if (this.customer != null) {
data['customer'] = this.customer.toJson();
}
data['product'] = this.product;
// data['product'] = this.product;
return data;
}
}

@ -339,43 +339,18 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
itemBuilder: (context, index) {
return Container(
child: productTile(
productName: model.orderListModel[0]
.orderItems[index].product.name
.toString(),
productPrice: model.orderListModel[0]
.orderItems[index].product.price
.toString(),
productRate: model.orderListModel[0]
.orderItems[index].product.approvedRatingSum
.toDouble(),
productReviews: model
.orderListModel[0]
.orderItems[index]
.product
.approvedTotalReviews,
totalPrice:
"${(model.orderListModel[0].orderItems[index].product.price * model.orderListModel[0].orderItems[index].quantity).toStringAsFixed(2)}",
qyt: model.orderListModel[0].orderItems[index]
.quantity
.toString(),
productName: model.orderListModel[0].orderItems[index].product.name.toString(),
productPrice: model.orderListModel[0].orderItems[index].product.price.toString(),
productRate: model.orderListModel[0].orderItems[index].product.approvedRatingSum.toDouble(),
productReviews: model.orderListModel[0].orderItems[index].product.approvedTotalReviews,
totalPrice: "${(model.orderListModel[0].orderItems[index].product.price * model.orderListModel[0].orderItems[index].quantity).toStringAsFixed(2)}",
qyt: model.orderListModel[0].orderItems[index].quantity.toString(),
isOrderDetails: true,
imgs: model.orderListModel[0].orderItems[index]
.product.images !=
null &&
model
.orderListModel[0]
.orderItems[index]
.product
.images
.length !=
0
? model.orderListModel[0].orderItems[index]
.product.images[0].src
.toString()
: null,
imgs: model.orderListModel[0].orderItems[index].product.images != null &&
model.orderListModel[0].orderItems[index].product.images.length != 0
? model.orderListModel[0].orderItems[index].product.images[0].src.toString() : null,
status: model.orderListModel[0].orderStatusId,
product: model.orderListModel[0]
.orderItems[index].product,
product: model.orderListModel[0].orderItems[index].product,
),
);
}),

Loading…
Cancel
Save