toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final Map<String, dynamic> data = new Map<String, dynamic>();
  data['_id'] = this.sId;
  data['orderDate'] = this.orderDate;
  data['orderId'] = this.orderId;
  data['bookingId'] = this.bookingId;
  data['shippingFees'] = this.shippingFees;
  data['returnReason'] = this.returnReason;
  data['returnRejectionReason'] = this.returnRejectionReason;
  data['cancellationReason'] = this.cancellationReason;
  data['paymentMode'] = this.paymentMode;
  data['checkPackage'] = this.checkPackage;
  data['imageUrl'] = this.imageUrl;
  data['paymentStatus'] = this.paymentStatus;
  data['orderStatus'] = this.orderStatus;
  data['orderType'] = this.orderType;
  if (this.history != null) {
    data['history'] = this.history!.map((v) => v.toJson()).toList();
  }
  if (this.user != null) {
    data['user'] = this.user!.toJson();
  }
  if (this.price != null) {
    data['price'] = this.price!.toJson();
  }
  if (this.billingAddress != null) {
    data['billingAddress'] = this.billingAddress!.toJson();
  }
  if (this.shippingAddress != null) {
    data['shippingAddress'] = this.shippingAddress!.toJson();
  }
  if (this.orderProducts != null) {
    data['orderProducts'] =
        this.orderProducts!.map((v) => v.toJson()).toList();
  }
  data['__typename'] = this.sTypename;
  return data;
}