mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
This PR introduces a new optional callback, onLongPressUp, to the InkWell widget. It allows developers to respond specifically to the moment when a long press gesture is released, which previously was not directly exposed. **Before** There was no way to distinguish between the long press being held and the moment it ended. **After** InkWell now accepts an onLongPressUp callback, which fires when the user lifts their finger after a long press gesture. This change enhances gesture handling granularity for widgets that require different behaviors for long press hold and release. **Related Issue** #173390 **Tests** - Added a new test to ink_well_test.dart verifying that onLongPressUp is correctly triggered after a long press is released. **Checklist** - I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - I read the [Tree Hygiene] wiki page. - I followed the [Flutter Style Guide]. - I signed the [CLA]. - I updated/added relevant documentation (/// doc comments). - I added new tests to check the change I am making. - All existing and new tests are passing. --------- Co-authored-by: Victor Sanni <victorsanniay@gmail.com> Co-authored-by: engine-flutter-autoroll <engine-flutter-autoroll@skia.org> Co-authored-by: Reid Baker <1063596+reidbaker@users.noreply.github.com> Co-authored-by: Jon Ihlas <jon.i@hotmail.fr> Co-authored-by: Matthew Kosarek <matt.kosarek@canonical.com> Co-authored-by: gaaclarke <30870216+gaaclarke@users.noreply.github.com> Co-authored-by: Micael Cid <micaelcid10@gmail.com> Co-authored-by: Alexander Aprelev <aam@google.com> Co-authored-by: Tong Mu <dkwingsmt@users.noreply.github.com>