OrderDetailsModel.fromJson constructor Null safety

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

Implementation

factory OrderDetailsModel.fromJson(Map<String, dynamic> json) =>
    OrderDetailsModel(
      address: json["address"] == null
          ? null
          : AddressModel.fromJson(json["address"]),
      store: json["store"] == null ? null : Store.fromJson(json["store"]),
      orderItems: json["orderItems"] == null
          ? null
          : List<OrderItem>.from(
              json["orderItems"].map((x) => OrderItem.fromJson(x))),
      currency: json["currency"],
      paymentType: json["paymentType"],
      canCancel: json["canCancel"],
      date: json["date"],
      id: json["id"],
      orderNo: json["orderNo"],
      productsCount: json["productsCount"],
      total: json["total"] == null ? null : json["total"]!.toDouble(),
      orderStatus: json["orderStatus"],
    );