removeAllAndNavigateTo method
void
removeAllAndNavigateTo(
Remove all from the navigation stack and go to route. this method empties out the navigation stack and puts the "routedTo" view on top. This feature is especially useful for instance for logging out.
Implementation
void removeAllAndNavigateTo(String routeName) {
_navigatorState.pushNamedAndRemoveUntil(
routeName,
(Route<dynamic> route) => false,
);
}