I want to know how can I add a similar registerOnPageChangeCallback
in VerticalPager as we already have ViewPager2.
I want to perform some tasks when the pager is in an idle state. but the problem is that the VerticalPager block calls multiple times for the same position and can't find anything else similar to perform this task.
VerticalPager(state = pagerState){
}
this block calls multiple times in the same position and I have some tasks that I have to perform a single time in this block
You can do it by checking current page by passing indices to your pages and
And using both in a derivedState you can trigger a function inside
LaunchedEffect
.It would also be better a boolean for if this is current page and currentPageOffsetFraction if there is nothing else to be done with pagerState.