flattenHtmlComponents method

List flattenHtmlComponents(
  1. dynamic htmlComponents
)

Implementation

List<dynamic> flattenHtmlComponents(var htmlComponents) {
  var flatHtmlComponents = [];
  for (var comp in htmlComponents) {
    if (comp["controlType"] == 'PANEL') {
      var panelComp = comp;
      panelComp["componentList"]
          .forEach((element) => flatHtmlComponents.add(element));
    } else {
      flatHtmlComponents.add(comp);
    }
  }
  return flatHtmlComponents;
}