TaskElement.fromMap constructor
TaskElement.fromMap(
- Map<String, dynamic> json
)
Implementation
factory TaskElement.fromMap(Map<String, dynamic> json) => TaskElement(
taskDesc: json["taskDesc"] ?? "",
event: json["event"] ?? "",
frequency: int.parse('${json["frequency"] ?? 0}'),
logic: json["logic"] ?? "",
// conditions: json["conditions"] != null
// ? Conditions.fromMap(json["conditions"])
// : Conditions(
// type: '', value: Value(key: '', operator: '', value: '')),
rewards:
List<Reward>.from(json["rewards"].map((x) => Reward.fromMap(x))),
status: json["status"] ?? "",
dateCompleted: json["dateCompleted"],
taskId: json["taskId"],
);