canTransitionFrom method

  1. @override
bool canTransitionFrom (TransitionRoute previousRoute)
override

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

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

Implementation

@override
bool canTransitionFrom(TransitionRoute<dynamic> previousRoute) {
  return previousRoute is MaterialPageRoute || previousRoute is CupertinoPageRoute;
}