-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Add an example and update GestureDetector documentation
#102360
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
Add an example and update GestureDetector documentation
#102360
Conversation
aee2167 to
90b9f3b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This section is a little confusing/misleading. In particular: onTapDown is always called (not might be called), I think, and if the detector looses in the arena onTapCancel will be called after the arena is already resolved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this (and the other handler) actually only set one variable? Right now, this doesn't actually illustrate that only one handler gets called. They could be called both as one handler would just override the behavior of the previous one.
If we do this, maybe also include a reset button in the sample to remove the boarders.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my last commit, I replaced this with an enum and used it to set only one variable. I also added a reset button.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe explicitly state here that because the child wins, its onTap is called and the parent's onTap is not called.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/Given/Consider/ to make it a full sentence.
|
@bleroux Do you still have plans to come back to this one to address the feedback given above? |
c560943 to
5d8cbf4
Compare
Piinks
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the updates! There are a few grammar and spelling nits below, once those are resolved this should be good to land. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| /// its callbacks even though it looses in the arena. | |
| /// its callbacks even though it loses in the arena. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like there is a typo here somewhere, or copy-pasta. Does this sound right?
| /// wins because it was the first detector to enter the arena and it got first | |
| /// because it is in front. | |
| /// wins because it was the first detector to enter the arena. |
5d8cbf4 to
fc3f36e
Compare
fc3f36e to
d65e017
Compare
Piinks
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.

Description
This PR is a first step towards fixing #74733.
This first step is to add a troubleshooting section and an example to GestureDetector documentation.
It focuses on nested GestureDetector as it is a common use case that leads to misunderstanding (#92103).
The provided example is simple and aims to help users to investigate gesture issues, for instance it introduces
debugPrintGestureArenaDiagnostics.It doesn’t explain why
HitTestBehavior.transparentandHitTestBehavior.opaquehave no impact in this case.I will submit another PR to update HitTestBehavior documentation using @Hixie diagrams and explanations from #74733
Related Issue
Fixes #92103
Tests
Add a test for the new example
Pre-launch Checklist
///).