Subscription.fromJson constructor
Subscription.fromJson(
- Map<String, dynamic> json
)
Implementation
factory Subscription.fromJson(Map<String, dynamic> json) => Subscription(
freeTrial: FreeTrial.fromJson(json["freeTrial"]),
benefits: json["benefits"] == null ? null : json["benefits"],
physical: json["physical"] == null ? null : json["physical"],
digital: json["digital"] == null ? null : json["digital"],
adFree: json["adFree"] == null ? null : json["adFree"],
migrated: json["migrated"] == null ? null : json["migrated"],
couponsEnabled:
json["couponsEnabled"] == null ? null : json["couponsEnabled"],
adminCoupon: json["adminCoupon"] == null ? null : json["adminCoupon"],
usedCouponNumbers:
List<dynamic>.from(json["usedCouponNumbers"].map((x) => x)),
id: json["_id"] == null ? null : json["_id"],
recommended: json["recommended"] == null ? null : json["recommended"],
enabled: json["enabled"] == null ? null : json["enabled"],
clientId: json["clientId"] == null ? null : json["clientId"],
title: json["title"] == null ? null : json["title"],
iconUrl: json["iconUrl"] == null ? null : json["iconUrl"],
tiers: List<Tier>.from(json["tiers"].map((x) => Tier.fromJson(x))),
createdAt: DateTime.parse(json["createdAt"]),
updatedAt: DateTime.parse(json["updatedAt"]),
v: json["__v"] == null ? null : json["__v"],
couponCount: json["couponCount"] == null ? null : json["couponCount"],
currencySymbol:
json["currencySymbol"] == null ? null : json["currencySymbol"],
);