jackInTheBox static method

ScaleTransition jackInTheBox(
  1. Animation<double> animation,
  2. Widget child
)

盒子跳动动画

Implementation

static ScaleTransition jackInTheBox(
  Animation<double> animation,
  Widget child,
) {
  return ScaleTransition(
    scale: Tween<double>(begin: 0.1, end: 1.0).animate(
      CurvedAnimation(
        parent: animation,
        curve: const Interval(0.0, 0.5, curve: Curves.bounceOut),
      ),
    ),
    child: RotationTransition(
      turns: Tween<double>(begin: 0.25, end: 0.0).animate(
        CurvedAnimation(
          parent: animation,
          curve: const Interval(0.5, 1.0, curve: Curves.bounceOut),
        ),
      ),
      child: child,
    ),
  );
}