zoomOutLeft static method

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

缩小左移动画

Implementation

static AnimatedBuilder zoomOutLeft(
  Animation<double> animation,
  Widget child,
) {
  return AnimatedBuilder(
    animation: animation,
    builder: (context, child) {
      double offset = -300.0 * (1.0 - animation.value); // 左移偏移量
      return Transform.translate(
        offset: Offset(offset, 0),
        child: ScaleTransition(
          scale: Tween<double>(begin: 1.0, end: 0.0).animate(
            CurvedAnimation(parent: animation, curve: Curves.easeIn),
          ),
          child: FadeTransition(
            opacity: animation,
            child: child,
          ),
        ),
      );
    },
    child: child,
  );
}