fromJson static method

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

Implementation

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

  return WebPageInstantView(
    blocks: List<PageBlock>.from(
      tdListFromJson(json['blocks'])
          .map((item) => PageBlock.fromJson(tdMapFromJson(item)))
          .whereType<PageBlock>(),
    ),
    viewCount: (json['view_count'] as int?) ?? 0,
    version: (json['version'] as int?) ?? 0,
    isRtl: (json['is_rtl'] as bool?) ?? false,
    isFull: (json['is_full'] as bool?) ?? false,
    feedbackLink: InternalLinkType.fromJson(
      tdMapFromJson(json['feedback_link']),
    ),
  );
}