Skip to content

CupertinoSlider should provide haptic feedback #165847

Closed

Description

@Piinks

CupertinoSlider doesn't have a haptic when reaching the min/max value, on native there is a haptic but it's a bit tricky, the strength of the haptic depends on how hard you "slam" the slider to the max or min, the harder the slam the harder the haptic.

Activity

  1. added
    a: fidelityMatching the OEM platforms better
    p: cupertino_uicupertino_ui package in flutter/packages
    team-designOwned by Design Languages team
    on Mar 25, 2025
  2. SanjaySiddharth commented on Apr 5, 2025

    @SanjaySiddharth

    Hello @Piinks ,
    can I please try working on this issue ? Since this would be my first contribution here, could you please provide me with some hints / files to look out for the above request ?

  3. Piinks commented on Apr 7, 2025

    @Piinks
    ContributorAuthor

    Hi @SanjaySiddharth thanks for contributing! I have not looked into this issue, so I am sorry I cannot make a recommendation on how to resolve it. I would maybe look at other examples of haptic feedback being used in the framework. Feel free to share what you find here, or any thoughts you have for ways to resolve this. We're happy to give feedback early before folks start writing code. :)

  4. SanjaySiddharth commented on Apr 10, 2025

    @SanjaySiddharth

    Hello @Piinks ,

    Thanks for the heads up ! I found that the code for slider in iOS is present in cupertino folder and the haptic feedbacks can be called from the haptic_feedback file from services folder . My initial thoughts are :

    1. we can track the time it takes for the slider to travel from 7.0 to 10.0 or 3.0 to 1.0 for hitting max / min values respectively. The values used in this point are purely suggestive.
    2. the time taken can be used to classify if the impact is lightImpact , mediumImpact or heavyImpact ?
    3. if the max or min values are not hit , we can set it to play the .selectionClick method instead ?

    Please let me know your views .

  5. Piinks commented on Apr 17, 2025

    @Piinks
    ContributorAuthor

    That sounds promising thank you! I will be sure to check out the PR as well! Curious, did you look into what the native behavior is or any documentation about it from Apple?

  6. alex-medinsh commented on Apr 18, 2025

    @alex-medinsh
    Contributor

    Hi @Piinks! I am the author of the PR but not the author of the comment. The issue was unassigned and no PR was linked so I started working on this. Didn't notice the comment, so I am sorry if someone was already working on another PR for this issue.

    I tried looking through the Apple's documentation and HIG and haven't found the actual values that they use, so these are eyeballed values. We can tune them if you think I got them wrong.

  7. github-actions commented on May 24, 2025

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  8. locked as resolved and limited conversation to collaborators on May 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work lista: fidelityMatching the OEM platforms betterp: cupertino_uicupertino_ui package in flutter/packagesr: fixedIssue is closed as already fixed in a newer versionteam-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions