Hi everyone, hope you are all doing well. I am try...
# compose-ios
d
Hi everyone, hope you are all doing well. I am trying to figure out how to make
PullToRefreshContainer
work with swipe in compose multiplatform. I can't get it to start refreshing when there is swipe down (that was behaviour I would expect for it, like in Android) Code is in the thread
Copy code
fun App(rootComponent: RootComponent) {
    LunchBreakTheme {
        val state = rememberPullToRefreshState()
        Box (modifier= Modifier.fillMaxSize().background(color= Color.Green).nestedScroll(state.nestedScrollConnection)){
            PullToRefreshContainer(state = state)
        }
}
It just doesn't work, its state is not automatically changing on swipe
Btw it work if lazy column is inside the Box, otherwise it doesn't
Okay solved by adding
verticalScroll
to the
Box
component but honestly I really don't like this
👍 1
Is there a way to do this without having the box scrollable
a
Can you please post working code with
verticalScroll
?
d
Copy code
fun App(rootComponent: RootComponent) {
    LunchBreakTheme {
        val state = rememberPullToRefreshState()
        Box (modifier= Modifier.fillMaxSize().background(color= Color.Green).verticalScroll(state=rememberScrollState()).nestedScroll(state.nestedScrollConnection)){
            PullToRefreshContainer(state = state)
        }
}
Just add it your `Box`'s
Modifier
a
Looks like your solution is good!
d
It sure does work :D, but I don't think that we should be adding vertical scroll to these components just in order to have
PullToRefreshIndicator
in
material3
, I would be happier with having something like
Material.pullRefresh()
like it was the case with
material