setColumn method

  1. @override
void setColumn(
  1. int index
)
override

Implementation

@override
void setColumn(int index) {
  if (_datas != null && _col == index + 1) return;
  _col = index + 1;
  if (isArray) {
    // ignore: avoid_print
    if (picker!.printDebug) print("index: $index");
    if (_col < data.length) {
      _datas = data[_col].children;
    } else {
      _datas = null;
    }
    return;
  }
  if (index < 0) {
    _datas = data;
  } else {
    _datas = data;
    // 列数过多会有性能问题
    for (int i = 0; i <= index; i++) {
      var j = picker!.selecteds[i];
      if (_datas != null && _datas!.length > j) {
        _datas = _datas![j].children;
      } else {
        _datas = null;
        break;
      }
    }
  }
}