RWidget<D>.fromJson constructor

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

Implementation

RWidget.fromJson(Map<String, dynamic> json) {
  id = json['id'];
  uiType = json['ui_type'];
  if (json['data'] != null) {
    data = parseData(json['data']);
  }

  if (json['children'] != null) {
    json['children']
        .map((child) => RWidgetParser.parse(child))
        .forEach((widget) => {
              if (widget != null) {children?.add(widget!)}
            });
  }
}