rollOut static method

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

向右边滚动退出动画

Implementation

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