dkwingsmt · GitHub

Use case

The spring animation is used all over iOS, and is critical to building widgets with iOS look and feel. Although Flutter currently provides spring simulators, they're not directly usable as animation curves.

Proposal

The spring animation is introduced here: https://developer.apple.com/videos/play/wwdc2023/10158/

(Github backup)

Goals:

  • Various ways to construct
    • Presets: Smooth, bouncy, flattened
    • Customize with bounce and duration
    • Professional customization with mass, stiffness, and damping
  • Velocity: Smoothly connect animations
  • Settling time: Continue the long-tail animation beyond duration

Convert bounce and duration to detailed parameters (from the video) (Wrong formula from Apple. We've figured out the right one):
image

Questions:

  • How extraBounce is applied
    • Done. The extraBounce is directly added to bounce.
  • How settlingDuration is derived (we might not need it since our spring simulator allows a settling tolerance)

Read the original on github.com ↗