animateTo method
Implementation
void animateTo(int value, {Duration? duration, Curve curve = Curves.ease}) {
if (value == _index) {
return;
}
_index = value;
_indexIsChangingCount += 1;
notifyListeners();
_animationController!
.animateTo(
_index.toDouble(),
duration: const Duration(milliseconds: 300),
curve: Curves.ease,
)
.whenCompleteOrCancel(() {
if (_animationController != null) {
_indexIsChangingCount -= 1;
notifyListeners();
}
});
}