getRootEntity method

SelectionEntity getRootEntity(
  1. SelectionEntity rootEntity
)

获取当前节点对应根节点

Implementation

SelectionEntity getRootEntity(SelectionEntity rootEntity) {
  if (rootEntity.parent == null ||
      rootEntity.parent!.maxSelectedCount ==
          SelectionConstant.maxSelectCount) {
    return rootEntity;
  } else {
    return getRootEntity(rootEntity.parent!);
  }
}