offNamed method

Future offNamed(
  1. String routeName, {
  2. Object? arguments,
  3. Object? result,
})

Replace the current named route with a new one.

This is similar to off, but for named routes.

Implementation

Future offNamed(String routeName, {Object? arguments, Object? result}) async =>
  await
    Navigator.pushReplacementNamed(context, routeName,
        arguments: arguments, result: result);