fromJson static method

PageBlockPhoto? fromJson(
  1. Map<String, dynamic>? json
)
override

Implementation

static PageBlockPhoto? fromJson(Map<String, dynamic>? json) {
  if (json == null) {
    return null;
  }

  return PageBlockPhoto(
    photo: Photo.fromJson(tdMapFromJson(json['photo'])),
    caption: PageBlockCaption.fromJson(tdMapFromJson(json['caption'])),
    url: (json['url'] as String?) ?? '',
    hasSpoiler: (json['has_spoiler'] as bool?) ?? false,
  );
}