pause method
void
pause()
Pauses the animation playback.
The current frame remains displayed, and the animation can be resumed from this point by calling play.
Implementation
void pause() {
isPlaying = false;
_timer?.cancel();
_timer = null;
}