flip static method

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

翻转动画

Implementation

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