Tournament.fromJson constructor

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

Implementation

factory Tournament.fromJson(Map<String, dynamic> json) => Tournament(
      id: json["id"],
      name: json["name"],
      lastEditDate: DateTime.parse(json["lastEditDate"]),
      dateStart: DateTime.parse(json["dateStart"]),
      dateEnd: DateTime.parse(json["dateEnd"]),
      type: json["type"] != null ? Type.fromJson(json["type"]) : null,
      season: json["season"],
      orgCommittee: json["orgcommittee"] != null
          ? List<Player>.from(
              json["orgcommittee"].map((x) => Player.fromJson(x)))
          : <Player>[],
      syncData: json["synchData"] != null
          ? SynchData.fromJson(json["synchData"])
          : null,
      mainPayment: json["mainPayment"],
      discountedPayment: json["discountedPayment"],
      discountedPaymentReason: json["discountedPaymentReason"],
      currency: json["currency"],
      editors: json["editors"] != null
          ? List<Player>.from(json["editors"].map((x) => Player.fromJson(x)))
          : <Player>[],
      difficultyForecast: json["difficultyForecast"],
      maiiAegis: json["maiiAegis"],
      maiiAegisUpdatedAt: json["maiiAegisUpdatedAt"] != null
          ? DateTime.parse(json["maiiAegisUpdatedAt"])
          : null,
      maiiRating: json["maiiRating"],
      maiiRatingUpdatedAt: json["maiiRatingUpdatedAt"] != null
          ? DateTime.parse(json["maiiRatingUpdatedAt"])
          : null,
      questionQty: json["questionQty"] != null
          ? Map.from(json["questionQty"])
              .map((k, v) => MapEntry<String, int>(k, v))
          : null,
    );