SportPrograms.fromJson constructor

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

Implementation

SportPrograms.fromJson(Map<String, dynamic> json) {
  if (json["id"] is String) id = json["id"];
  if (json["cardType"] is int) cardType = json["cardType"];
  if (json["numberOfExercices"] is int) {
    numberOfExercices = json["numberOfExercices"];
  }
  if (json["totalDuration"] is int) {
    totalDuration = json["totalDuration"];
  }
  if (json["programOwnerProId"] is int) {
    programOwnerProId = json["programOwnerProId"];
  }
  if (json["programPropertyId"] is int) {
    programPropertyId = json["programPropertyId"];
  }
  if (json["isPublished"] is int) isPublished = json["isPublished"];
  if (json["programPictureUrl"] is String) {
    programPictureUrl = json["programPictureUrl"];
  }
  if (json["name"] is String) name = json["name"];
  if (json["description"] is String) description = json["description"];
  if (json["programContents"] is List) {
    programContents = json["programContents"] == null
        ? null
        : (json["programContents"] as List)
            .map((e) => ProgramContents.fromJson(e))
            .toList();
  }
  if (json["programProperty"] is Map) {
    programProperty = json["programProperty"] == null
        ? null
        : ProgramProperty.fromJson(json["programProperty"]);
  }
}