animateTo method
Implementation
void animateTo(int newIndex) {
final int clamped = newIndex.clamp(0, _length - 1);
if (clamped == _index) return;
_index = clamped;
notifyListeners();
}
void animateTo(int newIndex) {
final int clamped = newIndex.clamp(0, _length - 1);
if (clamped == _index) return;
_index = clamped;
notifyListeners();
}