|
|
|
|
@ -21,8 +21,6 @@ import androidx.compose.runtime.Composable
|
|
|
|
|
import androidx.compose.runtime.derivedStateOf
|
|
|
|
|
import androidx.compose.runtime.getValue
|
|
|
|
|
import androidx.compose.runtime.remember
|
|
|
|
|
import androidx.compose.runtime.snapshots.SnapshotStateList
|
|
|
|
|
import androidx.compose.runtime.toMutableStateList
|
|
|
|
|
import androidx.lifecycle.viewmodel.navigation3.rememberViewModelStoreNavEntryDecorator
|
|
|
|
|
import androidx.navigation3.runtime.NavBackStack
|
|
|
|
|
import androidx.navigation3.runtime.NavEntry
|
|
|
|
|
@ -83,7 +81,7 @@ class NavigationState(
|
|
|
|
|
@Composable
|
|
|
|
|
fun NavigationState.toEntries(
|
|
|
|
|
entryProvider: (NavKey) -> NavEntry<NavKey>,
|
|
|
|
|
): SnapshotStateList<NavEntry<NavKey>> {
|
|
|
|
|
): List<NavEntry<NavKey>> {
|
|
|
|
|
val decoratedEntries = subStacks.mapValues { (_, stack) ->
|
|
|
|
|
val decorators = listOf(
|
|
|
|
|
rememberSaveableStateHolderNavEntryDecorator<NavKey>(),
|
|
|
|
|
@ -98,5 +96,4 @@ fun NavigationState.toEntries(
|
|
|
|
|
|
|
|
|
|
return topLevelStack
|
|
|
|
|
.flatMap { decoratedEntries[it] ?: emptyList() }
|
|
|
|
|
.toMutableStateList()
|
|
|
|
|
}
|
|
|
|
|
|