https://kotlinlang.org logo
#compose
Title
# compose
k

khairil.ushan

03/02/2024, 11:16 AM
Hey everyone, I have
Voyager
question. I checked and can't find channel for this lib, so hopefully this still the correct place. When using
TabNavigator
, how should we pass the `Scafold`'s contentPadding into the
CurrentTab
?
Copy code
val hazeState = remember { HazeState() }
    TabNavigator(HomeScreen()) {
        Scaffold(
            modifier = Modifier
                .fillMaxSize(),
            topBar = {
                TopBar(hazeState = hazeState)
            },
            bottomBar = {
                BottomBar(hazeState = hazeState)
            },
            content = { contentPadding ->
                // How to use the contentPadding in the content
                CurrentTab()
            }
        )
    }
And also how can I apply modifier to the CurrentTab ? In my case, I would like to apply
Modifier.haze
b

brandonmcansh

03/03/2024, 2:16 PM
Composition local would work
k

khairil.ushan

03/03/2024, 2:34 PM
Ah yeah. Will give it a try. Thanks!
3 Views