fromJson static method

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

Implementation

static PagePropsEntity fromJson(Map<String, dynamic> json) {
  final rawNodes = (json['nodes'] as List<dynamic>)
      .map((e) => _nodesParse.fromJson(
          e['type'], e, getIt<DynamicAttributes>(), getIt<ActionMapper>()))
      .whereType<CNode>()
      .toList();
  final nodes = _nodeRendering.renderFlatList(
    _nodeRendering.renderTree(
        _nodeRendering.renderComponents(rawNodes, json['page_id'])),
  );
  return PagePropsEntity(
    pageID: json['page_id'],
    nodes: nodes,
  );
}