Repository navigation
is there a way to navigate to a screen while inside of a tab? #347
Replies: 2 comments 1 reply
|
The |
|
The exception means the For the follow-up where the bottom bar should disappear, push onto an outer app navigator, with the tab Scaffold contained inside its initial screen. An explicit scoped reference avoids guessing whether you need val LocalAppNavigator = staticCompositionLocalOf<Navigator> {
error("App navigator missing")
}
// App entry point; TabsScreen owns the TabNavigator + bottom bar.
Navigator(TabsScreen) { appNavigator ->
CompositionLocalProvider(LocalAppNavigator provides appNavigator) {
CurrentScreen()
}
}
// Inside the tab's content:
val appNavigator = LocalAppNavigator.current
Button(onClick = { appNavigator.push(VendorScreen(vendor)) }) {
Text("View Menu")
}Now the app stack becomes If you want the bottom bar to remain, give that tab its own ordinary nested References: nested navigator hierarchy, TabNavigator implementation. |
Uh oh!
There was an error while loading. Please reload this page.
i have code that tries to send a user to a screen from a tab, but im getting this error and my app crashes everytime
Java.lang.ClassCastException: screens.vendor.VendorScreen cannot be cast to cafe.adriel.voyager.navigator.tab.TabAll reactions