flipInY static method

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

沿 Y 轴翻入动画

Implementation

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