I want to remove a specific route and stay on the same page without navigating to different page.
I have three pages PageA, PageB, PageC. I have the below code in PageC and removing PageB from Route stack. After removing it's navigating back to PageA (default route page). I want to stay on the RouteC without navigating.
final newRouteName = "/PageB";
navigatorKey.currentState!.popUntil((route) {
if (widget.routeSettings!.name == newRouteName) {
navigatorKey.currentState!.removeRoute(route);
}
return true;
});
Please help me, i stuck with this for days