I want to remove specific route in the route settings. I don't want the page to navigate from the current page. just want to remove specific route. or making the arguments null, once the arguements values are assigned to a variable.
I tried below navigator, but it's navigating to previous screens
Navigator.of(context).pushAndRemoveUntil(MaterialPageRoute( builder: (context) => LoginScreen()), (Route route) => false);
Navigator.of(context).popUntil((route) => route.isFirst);
Please help me