Repository navigation
Replies: 1 comment
|
Yes. Navigator(HomeScreen) { navigator ->
Column {
ConsoleBackButton(
enabled = navigator.canPop,
onBack = { navigator.pop() },
)
CurrentScreen()
}
}
@Composable
fun ConsoleBackButton(
enabled: Boolean,
onBack: () -> Unit,
) {
Button(enabled = enabled, onClick = onBack) {
Text("Back")
}
}That button can live in a completely separate file. The callback also works for another UI event, such as a toolbar or keyboard action, without making that component know about Voyager. If the component is already a descendant of
References: stack operations, shared UI around CurrentScreen. |
Uh oh!
There was an error while loading. Please reload this page.
Hello, I'm developing an UI for my console that I made from PC i got
recently. I'm wondering, Is it possible to call popfrom piece
of code separate from the screen?
All reactions