rotateOutUpRight static method

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

右上角旋转退出动画

Implementation

static AnimatedBuilder rotateOutUpRight(
  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.topRight,
        child: FadeTransition(
          opacity: animation,
          child: child,
        ),
      );
    },
  );
}