to method

  1. @Deprecated("Avoid use this instance, you should use context.navigator.push(...)")
Future<void> to(
  1. Widget page, {
  2. bool transition = true,
})

Do that:

Navigator.push(
 transition
    ? MaterialPageRoute(builder: (_) => page)
    : PageRouteBuilder(pageBuilder: (_, __, ___) => page),
);

Implementation

@Deprecated(
    "Avoid use this instance, you should use context.navigator.push(...)")
Future<void> to(Widget page, {bool transition = true}) async {
  await Navigator.push(this, _pageRoute(page, transition));
}