'How to remove a particular route in flutter using Getx?

I want to get a particular named route from the navigation stack and remove it using Getx.

Example: if I have this route stack:

A -> B -> C -> D -> E

and my current route is: Get.currentRoute = E

Then, how to delete/remove C from the route stack? I need something like Get.deleteRoute(C).



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source