delegatedTransition static method
The Cupertino styled DelegatedTransitionBuilder provided to the previous route.
Used for the purposes of coordinating transitions between two routes with
different route transitions. When a route is added to the stack, the original
topmost route will look for this transition, and if available, it will use
the delegatedTransition
from the incoming transition to animate off the
screen.
If the return of the DelegatedTransitionBuilder is null, then by default the original transition of the routes will be used. This is useful if a route can conditionally provide a transition based on the BuildContext.
Implementation
static Widget? delegatedTransition(BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation, bool allowSnapshotting, Widget? child) {
final Animation<Offset> delegatedPositionAnimation =
CurvedAnimation(
parent: secondaryAnimation,
curve: Curves.linearToEaseOut,
reverseCurve: Curves.easeInToLinear,
).drive(_kMiddleLeftTween);
assert(debugCheckHasDirectionality(context));
final TextDirection textDirection = Directionality.of(context);
return SlideTransition(
position: delegatedPositionAnimation,
textDirection: textDirection,
transformHitTests: false,
child: child,
);
}