lightSpeedInRight static method

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

从右侧加速进入动画

Implementation

static AnimatedBuilder lightSpeedInRight(
  Animation<double> animation,
  Widget child,
) {
  return AnimatedBuilder(
    animation: animation,
    builder: (context, child) {
      final double translateX = (1.0 - animation.value) * 400;
      final double opacity = animation.value;
      return Transform.translate(
        offset: Offset(translateX, 0),
        child: Opacity(opacity: opacity, child: child),
      );
    },
    child: child,
  );
}