rollIn static method

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

从左边滚动进入动画

Implementation

static AnimatedBuilder rollIn(
  Animation<double> animation,
  Widget child,
) {
  return AnimatedBuilder(
    animation: animation,
    builder: (context, child) {
      final offset =
          Tween<Offset>(begin: const Offset(-1.0, 0.0), end: Offset.zero)
              .animate(animation);
      final angle =
          Tween<double>(begin: -math.pi / 2, end: 0.0).animate(animation);
      return Transform.translate(
        offset: offset.value,
        child: Transform.rotate(
          angle: angle.value,
          child: child,
        ),
      );
    },
    child: child,
  );
}