fromJson static method

Photo fromJson(
  1. Map json
)

Implementation

static Photo fromJson(Map json) {
  final thumbnailStr = JsonHelpers.decode<String>(json['thumbnail']);
  final fullSizeStr = JsonHelpers.decode<String>(json['fullSize']);
  return Photo(
    thumbnail: thumbnailStr != null ? base64Decode(thumbnailStr) : null,
    fullSize: fullSizeStr != null ? base64Decode(fullSizeStr) : null,
  );
}