fixed order details

merge-update-with-lab-changes
Fatimah Alshammari 5 years ago
parent 747763c4be
commit 8624d695dc

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

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

Loading…
Cancel
Save