switchTo method
Implementation
void switchTo(
int index,
int totalPages,
) {
if (index == _currentIndex) return;
_currentIndex = index;
_markAsUsed(index);
// _markAsUsed already calls _enforceMaxSize internally.
// Only flush aggressively if disposeUnused is enabled.
if (disposeUnused) {
_flushMemoryCache();
}
notifyListeners();
}