setSelectedItemId method

void setSelectedItemId(
  1. String id
)

API to set selected item with ID.

Exceptions:
Throws an ArgumentError if there is no item associated with the ID.

Implementation

void setSelectedItemId(String id) {
  if (!existItem(id)) {
    throw ArgumentError("setSelectedItemId : There is no item associated with the ID.");
  }
  selectedItemId = id;
}