checkControllerStatusAndPopIfNeeded method

void checkControllerStatusAndPopIfNeeded(
  1. AnimationStatus? status
)

Implementation

void checkControllerStatusAndPopIfNeeded(AnimationStatus? status) {
  if (status == AnimationStatus.dismissed) {
    if ((route?.isActive ?? false) && userGestureInProgress) return;
    if (userGestureInProgress) stopUserGesture();
    controller.removeStatusListener(checkControllerStatusAndPopIfNeeded);
    // preventing [TransitionRoute._handleStatusChanged] finalizeRoute conflict.
    WidgetsBinding.instance!.addPostFrameCallback((_) {
      closeRoute();
    });
  }
}