rotateOutDownRight static method

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

右下角旋转退出动画

Implementation

static AnimatedBuilder rotateOutDownRight(
  Animation<double> animation,
  Widget child,
) {
  return AnimatedBuilder(
    animation: animation,
    child: child,
    builder: (context, child) {
      final angle = -animation.value * pi / 2;
      final offset = animation.value * 200;
      return Transform(
        transform: Matrix4.rotationZ(angle)..translate(0.0, offset),
        alignment: Alignment.bottomRight,
        child: FadeTransition(
          opacity: animation,
          child: child,
        ),
      );
    },
  );
}