to static method

Future to(
  1. Widget page, {
  2. NavType? type,
  3. Widget? childCurrent,
  4. BuildContext? ctx,
  5. bool inheritTheme = false,
  6. Curve curve = Curves.linear,
  7. Alignment? alignment,
  8. Duration duration = const Duration(milliseconds: 300),
  9. Duration reverseDuration = const Duration(milliseconds: 300),
  10. bool fullscreenDialog = false,
  11. bool opaque = false,
})

Implementation

static Future to(
  Widget page, {
  NavType? type,
  Widget? childCurrent,
  BuildContext? ctx,
  bool inheritTheme = false,
  Curve curve = Curves.linear,
  Alignment? alignment,
  Duration duration = const Duration(milliseconds: 300),
  Duration reverseDuration = const Duration(milliseconds: 300),
  bool fullscreenDialog = false,
  bool opaque = false,
}) {
  return navigationKey.currentState!.push(
    type != null
        ? PageTransition(
            type: _type(type),
            child: page,
            childCurrent: childCurrent,
            ctx: ctx,
            inheritTheme: inheritTheme,
            curve: curve,
            alignment: alignment,
            duration: duration,
            reverseDuration: reverseDuration,
            fullscreenDialog: fullscreenDialog,
            opaque: opaque,
          )
        : Platform.isIOS || Platform.isMacOS
            ? CupertinoPageRoute(builder: (context) => page)
            : MaterialPageRoute(builder: (context) => page),
  );
}