Skip to content

Support SwiftUI's spring animation #152587

@dkwingsmt

Description

@dkwingsmt

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: animationAnimation APIsc: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Flutterframeworkflutter/packages/flutter repository. See also f: labels.team-frameworkOwned by Framework teamtriaged-frameworkTriaged by Framework team

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions