itemCount property

int get itemCount

Total number of items.

Implementation

int get itemCount => _itemCount;
set itemCount (int value)

Updates the item count.

Clamps focus to valid range.

Implementation

set itemCount(int value) {
  _itemCount = max(0, value);
  if (_itemCount == 0) {
    _focusedIndex = 0;
  } else {
    _focusedIndex = _focusedIndex.clamp(0, _itemCount - 1);
  }
}