selectedLastColumnList method
获取当前节点的所有选中的子节点
Implementation
List<SelectionEntity> selectedLastColumnList() {
List<SelectionEntity> list = [];
if (children.isNotEmpty) {
List<SelectionEntity> firstList = [];
for (SelectionEntity firstEntity in children) {
if (firstEntity.children.isNotEmpty) {
List<SelectionEntity> secondList = [];
for (SelectionEntity secondEntity in firstEntity.children) {
if (secondEntity.children.isNotEmpty) {
List<SelectionEntity> thirds =
SelectionUtil.currentSelectListForEntity(secondEntity);
if (thirds.isNotEmpty) {
list.addAll(thirds);
} else if (secondEntity.isSelected) {
secondList.add(secondEntity);
}
} else if (secondEntity.isSelected) {
secondList.add(secondEntity);
}
}
list.addAll(secondList);
} else if (firstEntity.isSelected) {
firstList.add(firstEntity);
}
}
list.addAll(firstList);
}
return list;
}