toNamed method

  1. @Deprecated("Avoid use this instance, you should use context.navigator.pushNamed(...)")
Future<void> toNamed(
  1. String routeName, {
  2. Object? arguments,
})

Do that:

Navigator.named(context, routeName, arguments: arguments);

Implementation

@Deprecated(
    "Avoid use this instance, you should use context.navigator.pushNamed(...)")
Future<void> toNamed(
  String routeName, {
  Object? arguments,
}) async {
  await Navigator.pushNamed(this, routeName, arguments: arguments);
}