NavEventNavigator
This allows to trigger navigation actions from outside the view layer without keeping references to Android framework classes that might leak. It also improves the testability of your navigation logic since it is possible to just write test that the correct events were emitted.
Functions
Triggers a new NavEvent that pops the back stack to the previous destination.
Triggers a new NavEvent to navigate to the given route.
Triggers a new NavEvent to navigate to the given root. The current back stack will be popped and saved. Whether the backstack of the given root
is restored depends on restoreRootState.
Triggers a new NavEvent that causes up navigation.
Reset the back stack to the given root. The current back stack will cleared and if root was already on it it will be recreated.