selectAt method

void selectAt(
  1. int index
)

Move selection to a specific index.

Clamps to valid range. Useful for tap-to-select in a list view.

Implementation

void selectAt(int index) {
  if (_results.isEmpty) {
    return;
  }
  _selectedIndex = index.clamp(0, _results.length - 1);
}