fromJson static method

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

Implementation

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

  return PageBlockEmbedded(
    url: (json['url'] as String?) ?? '',
    html: (json['html'] as String?) ?? '',
    posterPhoto: Photo.fromJson(tdMapFromJson(json['poster_photo'])),
    width: (json['width'] as int?) ?? 0,
    height: (json['height'] as int?) ?? 0,
    caption: PageBlockCaption.fromJson(tdMapFromJson(json['caption'])),
    isFullWidth: (json['is_full_width'] as bool?) ?? false,
    allowScrolling: (json['allow_scrolling'] as bool?) ?? false,
  );
}