removeRoute method
Navigation.removeRoute() shortcut.
Remove a specific route
from the stack
id
is for when you are using nested navigation,
as explained in documentation
Implementation
void removeRoute(Route<dynamic> route, {int? id}) {
return global(id).currentState?.removeRoute(route);
}