modal_bottom_sheet
modal_bottom_sheet copied to clipboard
iOS modal opening curve speed is different with native one
modal_bottom_sheet animation seems like using a linear curve, while native's one is using an easeOut curve
Any updates on this?
Right now it uses
const Curve _decelerateEasing = Cubic(0.0, 0.0, 0.2, 1.0);
I would like to know how to calculate the curve of the native animation
https://stackoverflow.com/questions/25726563/what-is-the-default-animation-easing-function-in-ios
according to them, it would be: Cubic(0.42, 0, 0.58, 1) over 0.25 seconds of duration
Which is ease-in-out
https://cubic-bezier.com/#.42,0,.58,1
https://stackoverflow.com/questions/25726563/what-is-the-default-animation-easing-function-in-ios
according to them, it would be:
Cubic(0.42, 0, 0.58, 1)over 0.25 seconds of duration Which isease-in-outhttps://cubic-bezier.com/#.42,0,.58,1
I'm afraid that post was outdated as it was over 8 years old ;(
I believe iOS currently use spring physics-based animation instead of a bezier curve. https://developer.apple.com/videos/play/wwdc2018/803/ (the part about spring driven animation starts around 23 mins mark). A few packages in pub.dev can do spring animation, like this https://github.com/lukepighetti/sprung. I don't know the exact parameters apple uses in their native animation but I think it should be possible to replicate it.
It would be nice if this package could expose the timing function or the animation controller so that the animation can be fine-tuned either to replicate native iOS animation or something else.
Any update on this?
Just wanted to follow up on this as well