I created a library for adding material3 bottom sh...
# feed
e
I created a library for adding material3 bottom sheet destinations to androidx-navigation (CMP is supported as well). I'm hoping this is a stop-gap until the Compose team provides their own, but until then, enjoy! https://github.com/eygraber/compose-material3-navigation
🙌 5
🙌🏼 1
h
when trying to run it on Android, I get this weird java.lang.IllegalStateException: You cannot access the Navigator’s state until the Navigator is attached
e
Hmm I haven't seen anything like that. How are you using it?
h
image.png
e
What does
backStackNavEntryController
do? Also can you send the stacktrace of the crash?
h
Copy code
@Composable
private fun backStackNavEntryController(navHostController: NavHostController): Triple<NavBackStackEntry?, NavBackStackEntry?, Boolean> {
    val currentEntry by navHostController.currentBackStackEntryFlow.collectAsStateWithLifecycle(
        null
    )

    val previousEntry by remember(currentEntry) {
        derivedStateOf {
            navHostController.previousBackStackEntry
        }
    }

    val hideBottomNavigation by remember(currentEntry) {
        derivedStateOf {
            currentEntry.hideBottomNavigation
        }
    }
    return Triple(currentEntry, previousEntry, hideBottomNavigation)
}
e
Can you file an issue on the repo? I'll take a look a little later today.
âž• 1