Repository navigation
Add onTertiaryTap* to TapGestureRecognizer and GestureDetector - #62788
Conversation
|
@dkwingsmt Can you review this, since I'm out this week? |
|
Fly-by comment: It looks like one of the new tests is failing on cirrus. |
|
@goderbauer Thank you! Sorry that I was not thorough enough. However, I do not understand why the |
|
(I am aware that tests-widgets are failing, however, I do not understand why that one test is failing) |
There was a problem hiding this comment.
- Since mouse is not the only device that can use a tertiary button, but also stylus, using
kMiddleMouseButtonis not accurate. Can you create a newkTertiaryButton, and replace all uses ofkMiddleMouseButtonin your new code to that? - We probably want to also add a
onTertiaryTapcallback just like the primary and secondary button. - The reason why the test fails is because the tertiary tap has no competition, which means the tertiary tap is accepted immediately on the down event. A primary or secondary tap, however, is competed by long press (thus the 2 long press callbacks) and must wait
kPressTimeoutbefore being accepted, which is interrupted by the drag. The solution is probably adding a tertiary long press callback. Also since you're confused by it, it'd be best if you can add a comment to explain this at the 2 long press callbacks.
Everything else looks good.
|
@dkwingsmt Thank you so much for the review! About 2. and 3.: I think that @gspencergoog pointed out that we might not want to have the other callbacks for tertiary pointers, #62488 (comment). What you said is logical to me - I just want to make sure that we are clear on that 👍🏼 |
|
Sounds good :) |
|
@dkwingsmt So I think it is just fixing |
|
I think he didn't say we shouldn't add the tertiary version of long press. But I don't think we NEED to add that either, at least before real demands come; but then to use the same logic of variants you might still need to create a private one just for this test. I can't think of other ways if we want too reuse the variant logic. |
|
@dkwingsmt that sounds good 👍🏽 |
|
@dkwingsmt I think I addressed everything. I only added the tertiary long press callbacks to the |
|
(I decided to move a fix I did to another PR, see #62897) |
|
@dkwingsmt Seems like the tests are all fine now. If I got the implementation right, this should be done 🙂 |
|
Seems a conflict is blocking the merge. |
|
@dkwingsmt resolved. |
Description
This PR aims to support the middle mouse button in Flutter (which is currently the only tertiary button).
The naming decision and the decision to omit the tap event were derived from #62488 (comment).
cc @gspencergoog
Related Issues
Tests
I added the following tests:
GestureDetectortests in all relevant files.Checklist
Before you create this PR, confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]). This will ensure a smooth and quick review process.///).flutter analyze --flutter-repo) does not report any problems on my PR.Breaking Change