flipOutX static method

AnimatedBuilder flipOutX(
  1. Animation<double> animation,
  2. Widget child
)

沿 X 轴翻出动画

Implementation

static AnimatedBuilder flipOutX(
  Animation<double> animation,
  Widget child,
) {
  return AnimatedBuilder(
    animation: animation,
    builder: (context, child) {
      final angle = math.pi * animation.value;
      return Transform(
        alignment: Alignment.center,
        transform: Matrix4.rotationX(angle)..scale(1.0 - animation.value),
        child: Opacity(opacity: 1.0 - animation.value, child: child),
      );
    },
    child: child,
  );
}