setIndex method
Implementation
void setIndex(int index) {
if (_state.phase != OverlayPhase.cardMode) return;
if (index < 0 || index >= _state.itemCount) return;
_state = _state.copyWith(currentIndex: index, horizontalDragOffset: 0.0);
notifyListeners();
}