SimpleCupertinoPageTransition constructor
SimpleCupertinoPageTransition({})
Creates an iOS-style page transition.
primaryRouteAnimation
is a linear route animation from 0.0 to 1.0 when this screen is being pushed.secondaryRouteAnimation
is a linear route animation from 0.0 to 1.0 when another screen is being pushed on top of this one.linearTransition
is whether to perform the transitions linearly. Used to precisely track back gesture drags.
Implementation
SimpleCupertinoPageTransition({
Key? key,
required Animation<double> primaryRouteAnimation,
required Animation<double> secondaryRouteAnimation,
required this.child,
Curve routeCurve = Curves.linearToEaseOut,
Curve reverseRouteCurve = Curves.easeInToLinear,
DecorationTween? decoration,
}) : _primaryPositionAnimation = CurvedAnimation(
parent: primaryRouteAnimation,
curve: routeCurve,
reverseCurve: reverseRouteCurve,
).drive(_kRightMiddleTween),
_secondaryPositionAnimation = CurvedAnimation(
parent: secondaryRouteAnimation,
curve: routeCurve,
reverseCurve: reverseRouteCurve,
).drive(_kMiddleLeftTween),
_userGesturePrimaryPositionAnimation = CurvedAnimation(
parent: primaryRouteAnimation,
curve: Curves.linear,
reverseCurve: Curves.linear,
).drive(_kRightMiddleTween),
_userGestureSecondaryPositionAnimation = CurvedAnimation(
parent: secondaryRouteAnimation,
curve: Curves.linear,
reverseCurve: Curves.linear,
).drive(_kMiddleLeftTween),
_primaryShadowAnimation = decoration != null
? CurvedAnimation(
parent: primaryRouteAnimation,
curve: routeCurve,
).drive(decoration)
: null,
super(key: key);