setHeight method

void setHeight(
  1. int h
)

Sets the height of the file picker.

Implementation

void setHeight(int h) {
  _height = h;
  _max = _min + _height - 1;
  if (_files.isEmpty) {
    _min = 0;
    _max = _height - 1;
    return;
  }
  if (_max >= _files.length) {
    _max = _files.length - 1;
    _min = (_max - _height + 1).clamp(0, _max);
  }
}