Skip to main content

rememberSaveableNavController

Function rememberSaveableNavController 

Source
pub fn rememberSaveableNavController<R: Clone + PartialEq + 'static>(
    key: &'static str,
    start: R,
    saver: Saver<R>,
) -> NavController<R>
Expand description

A NavController whose back stack is saved under key at each save boundary, as rememberSaveable state is, and restored when it is next created, after a process restart too. saver gives each route its saved form; it may read the forms older builds wrote.

The rememberSaveable state of each screen is saved with it, apart from other visits of the same route. A popped screen forgets its state. Restoring keeps the entries beneath the first route saver cannot read; when it cannot read the bottom one, or nothing was saved, the back stack starts at start.