AchievementModel.fromJson constructor
AchievementModel.fromJson(
- Map<String, dynamic> json
)
Implementation
factory AchievementModel.fromJson(Map<String, dynamic> json) {
return AchievementModel(
expiryDate: json["expiryDate"],
id: json["id"],
identifier: json["identifier"],
title: json["title"],
subTitle: json["subTitle"],
description: json["description"],
iconLink: json["iconLink"],
targetType: json["targetType"],
target: json["target"],
webhookUrl: json["webhookURL"],
webhookPostBodyCredentials: json["webhookPostBodyCredentials"],
expiry: json["expiry"],
expiryDays: json["expiryDays"],
accumulate: json["accumulate"],
isActive: json["isActive"],
levelOrderNumber: json["levelOrderNumber"],
canOptOut: json["canOptOut"],
metadata:
json["metadata"] == null ? null : Metadata.fromJson(json["metadata"]),
levelProgressFactor: json["levelProgressFactor"],
transactionRewardDetail: json["transactionRewardDetail"] == null
? null
: Metadata.fromJson(json["transactionRewardDetail"]),
importHash: json["importHash"],
createdAt: DateTime.tryParse(json["createdAt"] ?? ""),
updatedAt: DateTime.tryParse(json["updatedAt"] ?? ""),
deletedAt: json["deletedAt"],
tenantId: json["tenantId"],
createdById: json["createdById"],
updatedById: json["updatedById"],
// icon: json["icon"] == null
// ? []
// : List<dynamic>.from(json["icon"]!.map((x) => x)),
);
}