getSelectedChildCount method

int getSelectedChildCount(
  1. SelectionEntity entity
)

返回最后一层级【选中状态】 Item 的 个数

Implementation

int getSelectedChildCount(SelectionEntity entity) {
  if (PhoenixTools.isEmpty(entity.children)) {
    return entity.isSelected ? 1 : 0;
  }

  int count = 0;
  for (SelectionEntity child in entity.children) {
    count += getSelectedChildCount(child);
  }
  return count;
}