selectAtIndex method
Selects the item at the given index.
Does nothing if index is out of range, or the item is already
selected or disabled.
Implementation
void selectAtIndex(int index) {
if (index < 0 || index >= _items.length) {
return;
}
final item = _items[index];
if (item.disabled || item.selected) {
return;
}
_items[index] = item.copyWith(selected: true);
_reapplySearchFilter();
notifyListeners();
onSelectionChange?.call(selectedItems);
}