Photo.fromJson constructor
PexelsResult.fromJson Mapping data to Photo
Implementation
factory Photo.fromJson(Map<String, dynamic> json) {
/// [PexelsResult] Mapping object
return Photo(
id: json['id'] as int?,
width: json['width'] as int?,
height: json['height'] as int?,
photographerId: json['photographerId'] as int?,
url: json['url'] as String?,
photographer: json['photographer'] as String?,
photographerUrl: json['photographerUrl'] as String?,
avgColor: json['avgColor'] as String?,
src: PhotoSrc.fromJson(json['src']),
liked: json['liked'] as bool,
alt: json['alt'] as String?);
}