RipplePageTransition<T> constructor

RipplePageTransition<T>({
  1. required Widget page,
})

Implementation

RipplePageTransition({required this.page})
    : super(
        pageBuilder: (context, animation, secondaryAnimation) => page,
        transitionsBuilder: (context, animation, secondaryAnimation, child) {
          const begin = Offset(0.0, 0.0);
          const end = Offset.zero;
          const curve = Curves.easeInOut;
          var tween =
              Tween(begin: begin, end: end).chain(CurveTween(curve: curve));
          var offsetAnimation = animation.drive(tween);

          final scaleAnimation = Tween<double>(
            begin: 0.0,
            end: 1.0,
          ).animate(animation);

          final fadeAnimation = Tween<double>(
            begin: 0.0,
            end: 1.0,
          ).animate(animation);

          return FadeTransition(
            opacity: fadeAnimation,
            child: Transform.scale(
              scale: scaleAnimation.value,
              alignment: Alignment.center,
              child: SlideTransition(
                position: offsetAnimation,
                child: child,
              ),
            ),
          );
        },
      );