Nick
08/25/2021, 6:43 PMTheproperty is updated whenever the selected page changes. You can use thePagerState.currentPage
function to observe changes in a flow:snapshowFlow
LaunchedEffect(pagerState) {
snapshotFlow { pagerState.currentPage }.collect { page ->
// Selected page has changed...
}
}
Why can’t I just access the current page via pagerState.currentPage
? Why do I have to wrap it in a LaunchedEffect
and snapshotFlow
?Nick
08/25/2021, 6:50 PMPagerState.currentTab
cb
08/25/2021, 6:53 PMNick
08/25/2021, 6:53 PM