-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Adds callback onWillAcceptWithDetails in DragTarget. #131545
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
Adds callback onWillAcceptWithDetails in DragTarget. #131545
Conversation
87b239c to
2d880b9
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.
Is this similar to these two? if so, why do we not assert in this case that both are not set?
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 the case of onWillAccept and onWillAcceptWithDetails there is a discrepancy, what if one returns false and the other returns true? This is not the case between onAccept and onAcceptWithDetails though since it would just trigger these calls and the user may very well implement two different functionalities in both callbacks, even though it does not make any sense in doing that. The question as to whether we "should" put an assert for these two as well is debatable.
Any views here @goderbauer ?
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.
I think we should assert and make a plan to deprecate and migrate folks over to the newer APIs.
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.
I think we should assert and make a plan to deprecate and migrate folks over to the newer APIs.
Should this new assertion for onWillAccept and onWillAcceptWithDetails be managed in a separate PR and issue?
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.
Yeah, let's do that in a separate PR. I can if you'd like with the deprecations and dart fixes to migrate folks to the newer APIs. I think this change is ok to go ahead with.
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.
Is this meant to replace onWillAccept? Should onWillAccept be deprecated in favor of this new API?
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.
Based on what is highlighted by @goderbauer here, onWillAceeptWithDetails would eventually replace onWillAccept completely.
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.
Sounds good, when we run through triage today I will sync with @goderbauer on this. Before we land it, we should have a plan for deprecation and migration.
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.
Which could be relatively simple for this type of change, dart fix can rename this for folks really easily. :)
2d880b9 to
c90a846
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.
LGTM with a follow up PR to clean up the onAccept and onWillAccept. Let me know if you are interested in working on that. Thank you! :)
Sure I'll be happy to raise another PR for this :). |
justinmc
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.
LGTM 👍. +1 to deprecating in a follow-up.
e6ea553 to
85495fd
Compare
|
Filed #133347 for follow up, this should be clear to land now. :) |
|
auto label is removed for flutter/flutter/131545, due to - The status or check suite Linux web_canvaskit_tests_6 has failed. Please fix the issues identified (or deflake) before re-applying this label.
|
flutter/flutter@61d9f55...229b74d 2023-08-26 [email protected] Roll Flutter Engine from e280ed21f923 to c9b584d59219 (1 revision) (flutter/flutter#133380) 2023-08-26 [email protected] Roll Flutter Engine from 63fdf8a6701c to e280ed21f923 (3 revisions) (flutter/flutter#133378) 2023-08-26 [email protected] _SelectableFragment should dispatch creation in constructor. (flutter/flutter#133351) 2023-08-25 [email protected] Roll Flutter Engine from 53595c937df1 to 63fdf8a6701c (1 revision) (flutter/flutter#133366) 2023-08-25 [email protected] Roll Flutter Engine from 1ec7b89f3a6b to 53595c937df1 (4 revisions) (flutter/flutter#133362) 2023-08-25 [email protected] Roll Flutter Engine from 1471967afb9b to 1ec7b89f3a6b (6 revisions) (flutter/flutter#133355) 2023-08-25 [email protected] Fix locking to work with flutter and dart running simultaneously (flutter/flutter#133350) 2023-08-25 [email protected] Adds callback onWillAcceptWithDetails in DragTarget. (flutter/flutter#131545) 2023-08-25 [email protected] Remove deprecated onPlatformMessage from TestWindow and TestPlatformDispatcher (flutter/flutter#133183) 2023-08-25 [email protected] Remove deprecated androidOverscrollIndicator from ScrollBehaviors (flutter/flutter#133181) 2023-08-25 [email protected] Add an example showing how to use a MatrixTransition. (flutter/flutter#132874) 2023-08-25 [email protected] Roll Flutter Engine from 3dcd2179336d to 1471967afb9b (3 revisions) (flutter/flutter#133342) 2023-08-25 [email protected] Roll Flutter Engine from 33fca02451ef to 3dcd2179336d (3 revisions) (flutter/flutter#133340) 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],[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://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
This PR adds onWillAcceptWithDetails callback to DragTarget to get information about offset.
Fixes: #131378
This PR is subject to changes based on #131542
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.