expandMap method

Map<String, dynamic> expandMap(
  1. Map<String, dynamic> dataMap,
  2. Config config
)

@params @desc expand tree map

Implementation

Map<String, dynamic> expandMap(Map<String, dynamic> dataMap, Config config) {
  dataMap['open'] = false;
  dataMap['checked'] = 0;
  dataMap.putIfAbsent(dataMap[config.id], () => dataMap);
  (dataMap[config.children] ?? []).forEach((element) {
    expandMap(element, config);
  });
  return {"aaa": ""};
}