what is the right way of making something like a p...
# compose
e
what is the right way of making something like a page with multiple pages inside like viewPager and tab layouts , also how to handle the state of moving through them?
like should make it like Activity { Fragment1, Fragment2, Fragment3 } with tab layout or their this something like the flutter way of doing it !
a
If there isn't already a widget for it, I'm thinking you could do something like this:
Copy code
@Composable
fun MainScreen() {
  val currentScreenState = remember { } // current screen here
  
  Column {
      renderCurrentScreen(currentScreenState)
      Row {
          renderTabs(currentScreenState)
      }
  }
}
Then use the currenScreenState for highlighting the tabs. I think this might break down if there's deeper navigation in each tab though...or maybe it won't?
👍 1
e
i have seen libraries for it but before the alpha release, maybe there is something dedicated for that.