clear static method
void
clear()
Clears the recorded history. Routes still on the navigator stack are left alone — they are live state, not history, and dropping them would break duration tracking for screens the user still has open.
Implementation
static void clear() {
_routeHistory.clear();
routeArguments.clear();
routeVersion.value++;
}