Nick
08/25/2021, 6:43 PMTheproperty is updated whenever the selected page changes. You can use thePagerState.currentPagefunction 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.currentTabcb
08/25/2021, 6:53 PMNick
08/25/2021, 6:53 PM