GetOrderById.fromJson constructor

GetOrderById.fromJson(
  1. Map<String, dynamic> json
)

Implementation

GetOrderById.fromJson(Map<String, dynamic> json) {
  sId = json['_id'];
  orderDate = json['orderDate'];
  orderId = json['orderId'];
  bookingId = json['bookingId'];
  shippingFees = json['shippingFees'];
  returnReason = json['returnReason'];
  returnRejectionReason = json['returnRejectionReason'];
  cancellationReason = json['cancellationReason'];
  paymentMode = json['paymentMode'];
  checkPackage = json['checkPackage'];
  imageUrl = json['imageUrl'];
  paymentStatus = json['paymentStatus'];
  orderStatus = json['orderStatus'];
  orderType = json['orderType'] ?? 1;
  if (json['history'] != null) {
    history = <History>[];
    json['history'].forEach((v) {
      history!.add(new History.fromJson(v));
    });
  }
  user = json['user'] != null ? new User.fromJson(json['user']) : null;
  price = json['price'] != null ? new Price.fromJson(json['price']) : null;
  billingAddress = json['billingAddress'] != null
      ? new BillingAddress.fromJson(json['billingAddress'])
      : null;
  shippingAddress = json['shippingAddress'] != null
      ? new BillingAddress.fromJson(json['shippingAddress'])
      : null;
  if (json['orderProducts'] != null) {
    orderProducts = <OrderProducts>[];
    json['orderProducts'].forEach((v) {
      orderProducts!.add(new OrderProducts.fromJson(v));
    });
  }
  sTypename = json['__typename'];
}