EcpUnitPicker constructor

EcpUnitPicker({
  1. Key? key,
  2. int limitNum = noLimit,
  3. bool allowEmpty = false,
  4. List<BusinessGroupItemEntity>? selectUserList,
  5. String? title = '选择单位',
  6. bool appBarVisible = true,
  7. bool? clickWithoutConfirm = false,
  8. dynamic onParentSelect(
    1. List<BusinessGroupEntity> parents
    )?,
  9. OnSelected<BusinessGroupItemEntity>? onSelected,
  10. bool? showSelectedList,
  11. bool refreshEnable = false,
  12. bool loadMoreEnable = false,
  13. bool isAutoLeading = true,
  14. List<BusinessGroupItemEntity>? frozenList,
})

Implementation

EcpUnitPicker({
  super.key,
  super.limitNum,
  super.allowEmpty,
  super.selectUserList,
  super.title = '选择单位',
  super.appBarVisible,
  super.clickWithoutConfirm = false,
  super.onParentSelect,
  // super.searchHint = '请输入人员姓名进行搜索',
  super.onSelected,
  super.showSelectedList,
  super.refreshEnable = false,
  super.loadMoreEnable = false,
  super.isAutoLeading = true,
  super.frozenList,
}) : super(
        userSelectorBuilder: (ctx, proxy, item) {
          return EcpPickerTileItem<BusinessGroupItemEntity>(
            wrapper: item,
            showCheckBox: true,
            onDisplay: (data) => data.itemName ?? "",
          );
        },
        userSelectedBuilder: (ctx, item) {
          return EcpPickerTileItem<BusinessGroupItemEntity>(
            wrapper: item,
            showCheckBox: true,
            onDisplay: (data) => data.itemName ?? "",
          );
        },
        departmentBuilder: (ctx, proxy, group) {
          return EcpPickerTileItem<BusinessGroupEntity>(
            wrapper: SelectWrapper(origin: group),
            onDisplay: (data) => data.groupName ?? "",
            showCheckBox: false,
          );
        },
        crumbBuilder: (ctx, proxy, group) {
          return CrumbItem<BusinessGroupEntity>(
            crumb: group,
            last: proxy.crumbsList.isLast(group),
            onDisplay: (data) => data.groupName,
          );
        },
        userRepo: (group, index) async {
          if (group == null) {
            return null;
          }
          return EcpGlobalApi.getSysBusinessGroupItem(
            groupId: group.id,
            pageIndex: index,
          );
        },
        searchRepo: null,
        departmentRepo: (group) async {
          if (group == null) {
            return EcpGlobalApi.getSysBusinessGroup();
          }
          return null;
        },
        showIndex: false,
      );