pause method
void
pause()
Pauses the animation. If the animation is currently in the pausingBetweenAnimations
state, it moves to pausingBetweenAnimationsWithUserPauseRequested
, indicating
that once the internal pause finishes, the animation should remain paused.
Otherwise, it transitions directly into the userPaused
state.
Call this to pause the animation due to user interaction.
Implementation
void pause() {
if (stateNotifier.value == AnimatedTextState.pausedBetweenAnimations) {
stateNotifier.value = AnimatedTextState.pausedBetweenAnimationsByUser;
} else {
stateNotifier.value = AnimatedTextState.pausedByUser;
}
}