CheckoutReviewModel.fromJson constructor Null safety

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

Implementation

factory CheckoutReviewModel.fromJson(Map<String, dynamic> json) =>
    CheckoutReviewModel(
      items: json["items"] == null
          ? null
          : List<CartItemModel>.from(
              json["items"].map((x) => CartItemModel.fromJson(x))),
      summary: json["summary"] == null
          ? null
          : List<Summary>.from(
              json["summary"].map((x) => Summary.fromJson(x))),
      address: json["address"] == null
          ? null
          : AddressModel.fromJson(json["address"]),
      paymentOption: json["paymentOption"] == null
          ? null
          : PaymentOptionsModel.fromJson(json["paymentOption"]),
      total: json["total"] == null ? null : json["total"]!.toDouble(),
      configDeliveryPeriod: json["configDeliveryPeriod"] == null
          ? null
          : ConfigDeliveryPeriod.fromJson(json["configDeliveryPeriod"]),
    );