goBack

fun goBack()(source)

Goes back one step.

At the root of a non-start top-level destination this returns to the previously visited top-level destination rather than popping within the current one.

Calling this from NavigationState.startKey does nothing: there is nowhere left to go, and only the system back handler can finish the activity. Screens can therefore wire a back button straight to this method — a second tap arriving during an exit transition is harmless. Use canGoBack to decide whether to handle back at all.