void moveTo()

in example/lib/preload/ali_sliding_window.dart [112:127]


  void moveTo(int position) {
    if (position < 0 || position >= _itemList.length) return;
    if (_currentIndex == position) return;

    final currentWindow = getWindowIndices(position);
    if (currentWindow.isEmpty) return;

    final previousWindow = getWindowIndices(_currentIndex);
    final toLoad = _difference(currentWindow, previousWindow);
    final toCancel = _difference(previousWindow, currentWindow);

    _processItems(toCancel, _cancelItem);
    _processItems(toLoad, _executeItem);

    _currentIndex = position;
  }