Task.fromJson constructor

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

Implementation

factory Task.fromJson(Map<String, dynamic> json) => Task(
      title: json["title"],
      event: json["event"],
      frequency: json["frequency"],
      conditions: json["conditions"],
      referrerRewards: json["referrerRewards"] == null
          ? []
          : List<ReferreReward>.from(
              json["referrerRewards"]!.map((x) => ReferreReward.fromJson(x))),
      referreeRewards: json["referreeRewards"] == null
          ? []
          : List<ReferreReward>.from(
              json["referreeRewards"]!.map((x) => ReferreReward.fromJson(x))),
      id: json["_id"],
    );