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