pushNamedTransition<T> method

Future<T?> pushNamedTransition<T>({
  1. required String routeName,
  2. required PageTransitionType type,
  3. Object? arguments,
  4. Duration duration = const Duration(milliseconds: 200),
  5. Curve curve = Curves.linear,
  6. bool fullscreenDialog = false,
  7. bool opaque = false,
})

Implementation

Future<T?> pushNamedTransition<T>({
  required String routeName,
  required PageTransitionType type,
  Object? arguments,
  Duration duration = const Duration(milliseconds: 200),
  Curve curve = Curves.linear,
  bool fullscreenDialog = false,
  bool opaque = false,
}) {
  return Navigator.push<T>(
    this,
    PageTransition(
      settings: RouteSettings(name: routeName, arguments: arguments),
      type: type,
      childBuilder: (context) {
        final route = Navigator.of(context).widget.onGenerateRoute?.call(
              RouteSettings(name: routeName, arguments: arguments),
            ) as PageRoute;
        return route.buildPage(
          context,
          AlwaysStoppedAnimation(1.0),
          AlwaysStoppedAnimation(0.0),
        );
      },
      duration: duration,
      curve: curve,
      fullscreenDialog: fullscreenDialog,
      opaque: opaque,
    ),
  );
}