updateItemCount method

void updateItemCount(
  1. int count
)

Implementation

void updateItemCount(int count) {
  if (_state.itemCount == count) return;
  _state = _state.copyWith(
    itemCount: count,
    currentIndex: count > 0 ? _state.currentIndex.clamp(0, count - 1) : 0,
  );
}