RouteSlide constructor

RouteSlide(
  1. Widget widget, {
  2. Duration duration = const Duration(seconds: 1),
})

Implementation

RouteSlide(
  this.widget, {
  Duration duration = const Duration(seconds: 1),
}) : super(
          transitionDuration: duration,
          pageBuilder: (BuildContext context, Animation<double> animation1,
              Animation<double> animation2) {
            return widget;
          },
          transitionsBuilder: (BuildContext context,
              Animation<double> animation1,
              Animation<double> animation2,
              Widget child) {
            return SlideTransition(
              position: Tween<Offset>(
                      begin: Offset(-1.0, 0.0), end: Offset(0.0, 0.0))
                  .animate(CurvedAnimation(
                      parent: animation1, curve: Curves.fastOutSlowIn)),
              child: child,
            );
          });