slideTransition top-level property

RouteTransitionsBuilder slideTransition
final

Implementation

final RouteTransitionsBuilder slideTransition = (
  BuildContext context,
  Animation<double> animation,
  Animation<double> secondaryAnimation,
  Widget child,
) {
  Widget appear = SlideTransition(
    position: Tween<Offset>(
      begin: const Offset(-1.0, 0.0),
      end: const Offset(0.0, 0.0),
    ).animate(animation),
    child: child, // child is the value returned by pageBuilder
  );

  Widget disappear = SlideTransition(
    position: Tween<Offset>(
      begin: const Offset(0.0, 0.0),
      end: const Offset(1.0, 0.0),
    ).animate(secondaryAnimation),
    child: appear,
  );
  return disappear;
};