isSelectedCountExceed static method

bool isSelectedCountExceed(
  1. PickerEntity? entity
)

entity 传入当前点击的 Item !!! 在设置 isSelected = true之前进行 check。 返回 true 符合条件,false 不符合条件

Implementation

static bool isSelectedCountExceed(PickerEntity? entity) {
  if (entity == null || entity.parent == null) return false;
  return entity.parent!.getSelectedChildCount() <
      entity.parent!.maxSelectedCount;
}