FadeRoute<T> constructor

FadeRoute<T>(
  1. Widget widget, {
  2. int durationMs = Nav.defaultDurationMs,
})

Implementation

FadeRoute(this.widget, {int durationMs = Nav.defaultDurationMs})
    : super(
          pageBuilder: (BuildContext context, Animation<double> animation,
              Animation<double> secondaryAnimation) {
            return widget;
          },
          transitionDuration: Duration(milliseconds: durationMs),
          transitionsBuilder: (BuildContext context,
              Animation<double> animation,
              Animation<double> secondaryAnimation,
              Widget child) {
            return FadeTransition(
              opacity: Tween<double>(begin: 0.0, end: 1.0).animate(animation),
              child: child,
            );
          });