setIndex method

void setIndex(
  1. int index
)

Set index directly (from thumbnail tap or snap resolver).

Implementation

void setIndex(int index) {
  if (_state.verticalProgress > 0.01 || itemCount <= 0) return;
  final clamped = index.clamp(0, itemCount - 1);
  if (clamped != _state.currentIndex) {
    _state = _state.copyWith(currentIndex: clamped);
    notifyListeners();
  }
}