PexelPhotoModel.fromJson constructor

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

Implementation

PexelPhotoModel.fromJson(Map<String, dynamic> json) {
  if (json["id"] is int) this.id = json["id"];
  if (json["width"] is int) this.width = json["width"];
  if (json["height"] is int) this.height = json["height"];
  if (json["url"] is String) this.url = json["url"];
  if (json["photographer"] is String) this.photographer = json["photographer"];
  if (json["photographer_url"] is String) this.photographerUrl = json["photographer_url"];
  if (json["photographer_id"] is int) this.photographerId = json["photographer_id"];
  if (json["avg_color"] is String) this.avgColor = json["avg_color"];
  if (json["src"] is Map) this.src = json["src"] == null ? null : Src.fromJson(json["src"]);
  if (json["liked"] is bool) this.liked = json["liked"];
}