clearSelectedEntity method

void clearSelectedEntity()

Implementation

void clearSelectedEntity() {
  List<TSelectionEntity> tmp = [];
  TSelectionEntity node = widget.entityData;
  tmp.add(node);
  while (tmp.isNotEmpty) {
    node = tmp.removeLast();
    if (node.isSelected && (node.filterType == TSelectionFilterType.range || node.filterType == TSelectionFilterType.dateRange || node.filterType == TSelectionFilterType.dateRangeCalendar)) {
      if (node.customMap != null && !SelectionUtil.isEmpty(node.customMap!['min']) && !SelectionUtil.isEmpty(node.customMap!['max'])) {
        if (!node.isValidRange()) {
          isValid = false;
          if (node.filterType == TSelectionFilterType.range) {
            TToast.show('您输入的区间有误', context);
          } else if (node.filterType == TSelectionFilterType.dateRange || node.filterType == TSelectionFilterType.dateRangeCalendar) {
            TToast.show('您输入的区间有误', context);
          }
          return;
        }
      } else {
        node.isSelected = false;
      }
    }
    for (var data in node.children) {
      tmp.add(data);
    }
  }
}