Skip to content

Trigger CupertinoPicker haptics in the middle of the item #169670

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

RepliedSage11
Copy link
Contributor

@RepliedSage11 RepliedSage11 commented May 29, 2025

Towards #169606

This PR only fixes the haptic behaviour of CupertinoPicker, which now triggers only when passing the middle of the item.

Pre-launch Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • I signed the [CLA].
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is [test-exempt].
  • I followed the [breaking change policy] and added [Data Driven Fixes] where supported.
  • All existing and new tests are passing.

@github-actions github-actions bot added framework flutter/packages/flutter repository. See also f: labels. f: cupertino flutter/packages/flutter/cupertino repository labels May 29, 2025
@RepliedSage11
Copy link
Contributor Author

RepliedSage11 commented May 29, 2025

I'll look into the other part of the issue later if I get the bandwidth.

@MaherSafadii
Copy link

any chance you can get the ticking on selection working too, native iOS plays a tick sound on selection meanwhile Flutter doesn't, I achieved this functionality a while ago by calling this swift function using platform channels:

AudioServicesPlaySystemSoundWithCompletion(1157, nil)

here's the result:
https://x.com/mahersafadii/status/1790807026752278871

@RepliedSage11
Copy link
Contributor Author

@MaherSafadii where can I test this in native iOS?

@RepliedSage11
Copy link
Contributor Author

I tried a few native iOS apps, including system ones, and they don't seem to play any sounds?

I'm on iOS 18.5 btw

@RepliedSage11 RepliedSage11 marked this pull request as ready for review May 29, 2025 15:26
@MaherSafadii
Copy link

@MaherSafadii where can I test this in native iOS?

in the apple alarms app, there's a wheel picker.

I tried a few native iOS apps, including system ones, and they don't seem to play any sounds?

make sure your device isn't in silent mode otherwise it won't play the sound.

@RepliedSage11
Copy link
Contributor Author

@MaherSafadii It turns out that this sound does not play when you are wearing airpods.
I think this should be a separate issue, because there are things to consider with how the sounds should work and might require some additional work in the platform layer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
f: cupertino flutter/packages/flutter/cupertino repository framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants