Skip to content

Conversation

@ksokolovskyi
Copy link
Contributor

@ksokolovskyi ksokolovskyi commented Oct 29, 2025

Closes #150029

Description

  • Adds successNotification, warningNotification and errorNotification haptics to the framework
  • Adds UINotificationFeedbackTypeSuccess, UINotificationFeedbackTypeWarning and UINotificationFeedbackTypeError haptics support on iOS
  • Adds HapticFeedbackConstants.CONFIRM and HapticFeedbackConstants.REJECT haptics support on Android
  • Adds tests
iOS Android Web
UINotificationFeedbackTypeSuccess HapticFeedbackConstants.CONFIRM 20ms vibration
UINotificationFeedbackTypeWarning HapticFeedbackConstants.KEYBOARD_TAP 20ms vibration
UINotificationFeedbackTypeError HapticFeedbackConstants.REJECT 30ms vibration

Pre-launch Checklist

@ksokolovskyi ksokolovskyi requested review from a team as code owners October 29, 2025 13:06
@github-actions github-actions bot added platform-android Android applications specifically platform-ios iOS applications specifically framework flutter/packages/flutter repository. See also f: labels. engine flutter/engine related. See also e: labels. platform-web Web applications specifically team-android Owned by Android platform team team-ios Owned by iOS platform team labels Oct 29, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds support for success, warning, and error haptic notifications on Android, iOS, and web platforms. The changes are well-implemented on the Dart, Android, and web sides, including appropriate tests. However, the iOS implementation is missing tests for the new notification haptics, which I've highlighted as a medium-severity issue to ensure full test coverage and maintainability.

Copy link
Contributor

@reidbaker reidbaker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Android code looks good! Thank you for this contribution. I am going to do some work on our side to see of flutter team members have opinions on the default android behavior.

/// On iOS, this uses a `UINotificationFeedbackGenerator` with
/// `UINotificationFeedbackTypeWarning`.
///
/// On Android, this uses `HapticFeedbackConstants.KEYBOARD_TAP`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mboetger looking for your thoughts here. Android does not have the concept of warning haptic. This addition is a new api so it will be up to callers to decide if they want warning behaviors but flutter is now making a design statement about warnings and on api 30 and below warnings would have haptics and errors would not. On the other hand intentionally skewing androids behavior from iOS doesnt feel like the right call either.

Here is the best documentation I have found about haptics. https://developer.android.com/develop/ui/views/haptics/haptic-feedback

Do you think flutter should have haptics for warnings on android?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm ok with parity between iOS and Android here - but I think I have a more difficult time with warnings having haptics when errors do not. Especially since the only reason warnings DO exist below API 30 is the arbitrary choice of the HapticFeedbackConstants.KEYBOARD_TAP to represent the warnings. If another constant was chosen, a different API condition would exist.

I would prefer only turning on warnings for API 30 and beyond. Otherwise, it's going to feel strange to the user when it happens in some cases and not others.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@reidbaker @mboetger thanks a lot for your review!
I totally agree with your statements and applied the feedback in the latest commit. Could you please take a look again?

Copy link
Contributor

@mboetger mboetger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Android looks good to me.

Copy link
Contributor

@hellohuanlin hellohuanlin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iOS looks good

@ksokolovskyi
Copy link
Contributor Author

@mboetger @hellohuanlin thanks a lot for your review!
@dkwingsmt, may I ask you to find someone to review the web and framework parts?

@mboetger mboetger added team-web Owned by Web platform team team-framework Owned by Framework team labels Nov 5, 2025
Copy link
Contributor

@mdebbar mdebbar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

web changes look good!

@hellohuanlin hellohuanlin added autosubmit Merge PR when tree becomes green via auto submit App and removed autosubmit Merge PR when tree becomes green via auto submit App labels Nov 6, 2025
@hellohuanlin
Copy link
Contributor

@ksokolovskyi looks like you have approvals from all platforms, is this ready to land?

Copy link
Contributor

@dkwingsmt dkwingsmt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dkwingsmt dkwingsmt added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 6, 2025
@auto-submit auto-submit bot added this pull request to the merge queue Nov 6, 2025
Merged via the queue into flutter:master with commit c0e0529 Nov 7, 2025
191 of 192 checks passed
@flutter-dashboard flutter-dashboard bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Nov 7, 2025
@ksokolovskyi
Copy link
Contributor Author

Thanks a lot everyone for the review!

engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 7, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 7, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 7, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 8, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 9, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 9, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 11, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 11, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 11, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 12, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 12, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 12, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 12, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 12, 2025
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Nov 12, 2025
…10408)

Manual roll requested by [email protected]

flutter/flutter@31a8481...ee23168

2025-11-07 [email protected] Roll Packages from f13bad3 to 3caa48b (5 revisions) (flutter/flutter#178164)
2025-11-07 [email protected] Fix text input actions in DropdownMenu. (flutter/flutter#177313)
2025-11-07 [email protected] Roll Skia from f838c4b31edb to 581d1ecd5029 (1 revision) (flutter/flutter#178157)
2025-11-07 [email protected] Roll Skia from eb3c5b280ae6 to f838c4b31edb (3 revisions) (flutter/flutter#178149)
2025-11-07 [email protected] Roll Skia from 360fe72b5bf4 to eb3c5b280ae6 (1 revision) (flutter/flutter#178147)
2025-11-07 [email protected] Roll Skia from 116f237bb39d to 360fe72b5bf4 (4 revisions) (flutter/flutter#178146)
2025-11-07 [email protected] Roll Fuchsia Linux SDK from cm88aTLui5yorSGYQ... to qDVe2mrpSgQdxra7p... (flutter/flutter#178144)
2025-11-07 [email protected] fix: findChildIndexCallback to take seperators into account for seperated named constructor in ListView and SliverList (flutter/flutter#174491)
2025-11-06 [email protected] [web] Remove unnecessary android_sdk dep (flutter/flutter#178078)
2025-11-06 [email protected] Add haptic notifications support. (flutter/flutter#177721)
2025-11-06 [email protected] Allow label to be used to compute InputDecorator Intrinsic width (flutter/flutter#178101)
2025-11-06 [email protected] Respect product flavor abiFilters by adding a `disable-abi-filtering` Android project flag. (flutter/flutter#177753)
2025-11-06 [email protected] Use aria-hidden attribute for platform view accessibility on web (flutter/flutter#177969)
2025-11-06 [email protected] [tool] Fix IP parsing by using Uri constructor (flutter/flutter#178083)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
IvoneDjaja pushed a commit to IvoneDjaja/flutter that referenced this pull request Nov 22, 2025
Closes flutter#150029

### Description
- Adds `successNotification`, `warningNotification` and
`errorNotification` haptics to the framework
- Adds `UINotificationFeedbackTypeSuccess`,
`UINotificationFeedbackTypeWarning` and
`UINotificationFeedbackTypeError` haptics support on iOS
- Adds `HapticFeedbackConstants.CONFIRM` and
`HapticFeedbackConstants.REJECT` haptics support on Android
- Adds tests


| iOS | Android | Web |
|:-:|:-:|:-:|
| UINotificationFeedbackTypeSuccess | HapticFeedbackConstants.CONFIRM |
20ms vibration |
| UINotificationFeedbackTypeWarning |
HapticFeedbackConstants.KEYBOARD_TAP | 20ms vibration |
| UINotificationFeedbackTypeError | HapticFeedbackConstants.REJECT |
30ms vibration |

## Pre-launch Checklist

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

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
reidbaker pushed a commit to AbdeMohlbi/flutter that referenced this pull request Dec 10, 2025
Closes flutter#150029

### Description
- Adds `successNotification`, `warningNotification` and
`errorNotification` haptics to the framework
- Adds `UINotificationFeedbackTypeSuccess`,
`UINotificationFeedbackTypeWarning` and
`UINotificationFeedbackTypeError` haptics support on iOS
- Adds `HapticFeedbackConstants.CONFIRM` and
`HapticFeedbackConstants.REJECT` haptics support on Android
- Adds tests


| iOS | Android | Web |
|:-:|:-:|:-:|
| UINotificationFeedbackTypeSuccess | HapticFeedbackConstants.CONFIRM |
20ms vibration |
| UINotificationFeedbackTypeWarning |
HapticFeedbackConstants.KEYBOARD_TAP | 20ms vibration |
| UINotificationFeedbackTypeError | HapticFeedbackConstants.REJECT |
30ms vibration |

## Pre-launch Checklist

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

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

engine flutter/engine related. See also e: labels. framework flutter/packages/flutter repository. See also f: labels. platform-android Android applications specifically platform-ios iOS applications specifically platform-web Web applications specifically team-android Owned by Android platform team team-framework Owned by Framework team team-ios Owned by iOS platform team team-web Owned by Web platform team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HapticFeedback: Support UINotificationFeedbackType.success/warning/error on iOS

6 participants