selectIndex method

bool selectIndex(
  1. int index
)

Selects index, wrapping around the current result list.

Implementation

bool selectIndex(int index) {
  final count = filteredItems.length;
  if (count == 0) {
    selectedIndex = 0;
    return false;
  }
  selectedIndex = index % count;
  if (selectedIndex < 0) selectedIndex += count;
  return true;
}