ProductDetails.fromJson constructor

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

Implementation

factory ProductDetails.fromJson(Map<String, dynamic> json) => ProductDetails(
      productId: json.containsKey("productId") && json["productId"] != null ? json["productId"] : "",
      type: json.containsKey("type") && json["type"] != null ? json["type"] : "",
      title: json.containsKey("title") && json["title"] != null ? json["title"] : "",
      name: json.containsKey("name") && json["name"] != null ? json["name"] : "",
      description: json.containsKey("description") && json["description"] != null ? json["description"] : "",
      localizedIn: json.containsKey("localizedIn") && json["localizedIn"] != null ? List<String>.from(json["localizedIn"].map((x) => x)) : [],
      skuDetailsToken: json.containsKey("skuDetailsToken") && json["skuDetailsToken"] != null ? json["skuDetailsToken"] : [],
      subscriptionOfferDetails: json.containsKey("subscriptionOfferDetails") && json["subscriptionOfferDetails"] != null ?  List<SubscriptionOfferDetail?>.from(
              json["subscriptionOfferDetails"].map((x) => SubscriptionOfferDetail.fromJson(x))) : [],
      oneTimePurchaseOfferDetails: json.containsKey("oneTimePurchaseOfferDetails") && json["oneTimePurchaseOfferDetails"] != null
    ? _OneTimeNameValuePairs.fromJson(
          json["oneTimePurchaseOfferDetails"])
          : null,
    );