getFilledCustomInputItem static method

TSelectionEntity? getFilledCustomInputItem(
  1. List<TSelectionEntity> list
)

判断列表中是否有range类型

Implementation

static TSelectionEntity? getFilledCustomInputItem(
    List<TSelectionEntity> list) {
  TSelectionEntity? filledCustomInputItem;
  for (TSelectionEntity entity in list) {
    if (entity.isSelected &&
        (TSelectionFilterType.range == entity.filterType ||
            TSelectionFilterType.dateRange == entity.filterType ||
            TSelectionFilterType.dateRangeCalendar == entity.filterType) &&
        entity.customMap != null) {
      filledCustomInputItem = entity;
      break;
    }
    if (entity.children.isNotEmpty) {
      filledCustomInputItem = getFilledCustomInputItem(entity.children);
    }
    if (filledCustomInputItem != null) {
      break;
    }
  }
  return filledCustomInputItem;
}