build method
Implementation
@override
Widget build(BuildContext context, Animation<double> primaryAnimation,
Animation<double> secondaryAnimation, Widget child) {
var exitAnimation = secondaryAnimation as ProxyAnimation;
final double width = MediaQuery.of(context).size.width;
if (!exitAnimation.isDismissed) {
var animation = CurvedAnimation(parent: secondaryAnimation, curve: curve);
return Container(
color: backgroundColor,
child: Transform(
alignment: Alignment.bottomRight,
transform: Matrix4.identity()
..rotateZ(angle * animation.value)
..leftTranslate(width * animation.value),
child: child,
));
} else {
var animation = CurvedAnimation(parent: primaryAnimation, curve: curve);
return Transform(
alignment: Alignment.bottomLeft,
transform: Matrix4.identity()
..rotateZ(-angle * (1.0 - animation.value))
..leftTranslate(-width * (1.0 - animation.value)),
child: child,
);
}
}