build method
Implementation
@override
Widget build(BuildContext context, Animation<double> primaryAnimation,
Animation<double> secondaryAnimation, Widget child) {
var exitAnimation = secondaryAnimation as ProxyAnimation;
if (!exitAnimation.isDismissed) {
var animation = CurvedAnimation(parent: secondaryAnimation, curve: curve);
return Container(
color: backgroundColor,
child: Transform(
alignment: _exitPageAlignment,
transform: (direction == AxisDirection.left ||
direction == AxisDirection.right)
? (Matrix4.identity()..scale(1.0 - animation.value, 1.0))
: (Matrix4.identity()..scale(1.0, 1.0 - animation.value)),
child: child,
));
} else {
var animation = CurvedAnimation(parent: primaryAnimation, curve: curve);
return Transform(
alignment: _enterPageAlignment,
transform: (direction == AxisDirection.left ||
direction == AxisDirection.right)
? (Matrix4.identity()..scale(animation.value, 1.0))
: (Matrix4.identity()..scale(1.0, animation.value)),
child: child,
);
}
}