How do I add fling to a Modifier.draggable, with s...
# compose
f
How do I add fling to a Modifier.draggable, with snapping to a set of values if possibe?
t
f
Much thanks! Looks like I could make this work though I was hoping for something a bit simpler.
a
What about
Modifier.swipeable()
?
🙏 1
f
Thanks Albert, that looks like what I was after. Will need to see if it actually fits my use case because I want to be able to fling over several states if velocity is sufficient. Is there any resource that covers how to use it in depth?
a
I think the example in the doc is quite easy to understand. However I don't think what you want is possible using swipeable. I suggest you take a look at
Modifier.scrollable()
which has a
FlingBehavior
parameter by which you can use your own fling logic.
🙏 1
Just note that in beta02
FlingBehavior
won't be called if there's no fling velocity. This will be fixed in beta03.
c