clearNavigationHistory static method
void
clearNavigationHistory(
Removes all routes until the first route in the navigator stack.
Implementation
static void clearNavigationHistory(BuildContext context) {
Navigator.popUntil(context, (route) => route.isFirst);
}