canTransitionTo method

  1. @override
bool canTransitionTo (TransitionRoute nextRoute)
override

Whether this route can perform a transition to the given route.

Subclasses can override this method to restrict the set of routes they need to coordinate transitions with.

Implementation

@override
bool canTransitionTo(TransitionRoute<dynamic> nextRoute) {
  // Don't perform outgoing animation if the next route is a fullscreen dialog.
  return (nextRoute is MaterialPageRoute && !nextRoute.fullscreenDialog)
      || (nextRoute is CupertinoPageRoute && !nextRoute.fullscreenDialog);
}