setSelectedKey method

void setSelectedKey(
  1. K? key
)

Sets the selected key programmatically. This will try to resolve to an item if data is loaded.

Implementation

void setSelectedKey(K? key) {
  if (key == null) {
    _selectedKey = null;
    _selectedItem = null;
    _pendingKey = null;
    notifyListeners();
    return;
  }

  selectByKey(key);
}