Adds the onNextBeforePause callback to the animated widget.
Will be called at the end of n-1 animation, before the pause parameter
final void Function(int, bool)? onNextBeforePause;