This message was deleted.
# compose
s
This message was deleted.
n
Copy code
@ExperimentalPagerApi
@Composable
fun WelcomePage() {
    val pagerState = rememberPagerState(pageCount = 2)
    HorizontalPager(
        state = pagerState,
        offscreenLimit = 2,
    ) {

        when(this.currentPage){
            0 -> OnePage()
            1 -> TwoPage()
        }
    }
    Column(
        modifier = Modifier
            .fillMaxSize()
            .padding(bottom = 20.dp),
        verticalArrangement = Arrangement.Bottom,
        horizontalAlignment = Alignment.CenterHorizontally
    ) {
        HorizontalPagerIndicator(
            pagerState = pagerState,
        )
    }
}
The rest of the code is here https://paste.ubuntu.com/p/NC82F4R6q6/
s
I had the similar issue, You need to update current page with page.
You can check on sample App.
n
use it
instead of currentPage
m
cc @adeyds