toAndClearAllReplacementNamedRoute method

void toAndClearAllReplacementNamedRoute({
  1. String? routeName,
  2. Map<String, dynamic>? args,
})

Navigates to a new route, clearing all previous routes in stack.

If a valid BuildContext is provided, this method navigates to the specified named route, clearing all previous routes in the navigation stack.

Implementation

void toAndClearAllReplacementNamedRoute({String? routeName, Map<String,dynamic>? args}) {
  Navigator.pushNamedAndRemoveUntil(context, routeName!, (route) => true,
      arguments: args);
}