Flutter remove all routes

Posted by Editorial Staff | Updated on | Flutter

Flutter remove all routes. I was able to accomplish this with the following code:

The secret here is using a RoutePredicate that always returns false (Route route) => false. In this situation it removes all of the routes except for the new /login route I pushed.


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers