animateOut method

void animateOut()

Starts the reverse animation (animates the overlay out).

This method will only work if:

  • The controller is not disposed
  • The forward animation has completed
  • No reverse animation is currently running

Implementation

void animateOut() {
  if (_isDisposed || _animationControllerReverse == null) return;
  if (_animationControllerReverse!.isAnimating ||
      _animationControllerReverse!.status == AnimationStatus.completed) {
    return;
  }
  if (_animationController?.status != AnimationStatus.completed) return;
  _animationControllerReverse!.forward();
}