-
Notifications
You must be signed in to change notification settings - Fork 28.7k
Catch dismissable while it's animating. #1024
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
Conversation
This doesn't work as well as it should, because the vertical drag gesture and the horizontal drag gesture fight over who should own the pointer so if you put your finger down, it keeps animating. I'm not really sure how to handle that... either the horizontal gesture should always win when you tap an animating dismissable (and you can't drag vertically at that time -- that should be easy to do, by just having a flag that makes it greedy), or we should stop it on down, and then resume it when the horizontal drag doesn't win (using the onDragDown/onDragCancel pattern from tap). I propose doing that in a separate pass though. This patch is still an improvement over the status quo. |
LGTM The DrawerController has the same issue as you describe for the followup patch. I think the DragDown/DragCancel pattern will scale better than a greedy flag (and we've already gone down that path for tap). |
Another interesting case to look at is the Switch. Dragging the switch has a delay because the drag gesture is fighting with the tap gesture. However, the UX is arranged such that starting a drag and completing with a tap makes sense because they both want to drive the performance in the same direction. |
My main concern with having onDragDown, onDragDownMove, and onDragCancel is that it adds at least nine events to GestureDetector. I agree that it's probably the right solution though. |
Filed #1028 |
Catch dismissable while it's animating.
Also filed #1029 for the opacity regression. |
We could switch how GestureDetector works so that it takes a TapGestureClient and a DragGestureClient as argument instead of individual callbacks. Then you'd mix them into your State object. That would also make it obvious which callbacks were grouped together into one gesture. |
Updates the example app README with all the steps required for enabling the IAP APIs in Google Play and the App Store. Also adds a bit to the plugin's generic README. Changes the example app's android build script so that it requires the package ID to be changed and signing keys added in order for it to be ran. Users will need to set up their own package ID and signing keys for the example app to work with `BillingClient`. Also adds `StoreKit` and enables in app purchases to the XCode project. flutter#25987
Fixes #173.