popUntilNamedRoute method
Pops until a specific route is reached.
If a valid BuildContext is provided, this method pops routes from the navigation stack until the specified named route is reached.
Implementation
void popUntilNamedRoute({String? routeName, Map<String,dynamic>? args}) {
Navigator.popUntil(
context,
ModalRoute.withName(routeName!),
);
}