-
Notifications
You must be signed in to change notification settings - Fork 29.5k
Add more docs to DragTraget.builder #151447
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
I wrote these after having gone through the DragTarget docs tonight and having been confused. I also changed one reference to (deprecated) onWillAccept to onWillAcceptWithDetails. The other changes to remove ! are just from `dart format` running automatically in my editor. It appears that the modern analyzer is smart enough to not need the !. I'm happy to revert those if Flutter is intentionally not running `dart format` on files.
|
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact "@test-exemption-reviewer" in the #hackers channel in Chat (don't just cc them here, they won't see it! Use Discord!). If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
| /// over this [DragTarget] and that has passed [DragTarget.onWillAccept]. The | ||
| /// `rejectedData` argument contains the list of drag data that is hovering over | ||
| /// this [DragTarget] and that will not be accepted by the [DragTarget]. | ||
| /// over this [DragTarget] and that has passed |
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.
Can we update the comment as below :
/// The `candidateData` argument contains the list of drag data that is hovering
/// over this [DragTarget] and that has passed [DragTarget.onWillAcceptWithDetails].
/// The `rejectedData` argument contains the list of drag data that is hovering over this
/// [DragTarget] and that will not be accepted by the [DragTarget].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.
Did you just reformat it or am I missing what the change is?
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 changed one mention of (deprecated) DragTarget.onWillAccept to DragTarget.onWillAcceptWithDetails and re-wrapped.
| /// | ||
| /// [onWillAccept] or [onWillAcceptWithDetails] is called when a draggable | ||
| /// enters the target. If either return true, the data will appear in | ||
| /// `candidateData`, if they return false, the data will appear in |
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.
| /// `candidateData`, if they return false, the data will appear in | |
| /// `candidateData`, if both return false, the data will appear in |
|
Omitting the error • The argument type 'Offset?' can't be assigned to the parameter type 'Offset'. • packages/flutter/lib/src/widgets/drag_target.dart:749:123 • argument_type_not_assignable |
|
test-exempt: documentation change with no semantic changes |
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.
Thanks for the PR Eric! Usually when I see your name on GitHub it's something that's like 6 years old so I had to double check :)
LGTM if you just get the analyzer passing, everything else is nits.
| /// over this [DragTarget] and that has passed [DragTarget.onWillAccept]. The | ||
| /// `rejectedData` argument contains the list of drag data that is hovering over | ||
| /// this [DragTarget] and that will not be accepted by the [DragTarget]. | ||
| /// over this [DragTarget] and that has passed |
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.
Did you just reformat it or am I missing what the change is?
|
Fixes applied, PTAL. |
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 👍
Clarifications and changing a reference to a deprecated member.
Clarifications and changing a reference to a deprecated member.
I wrote these after having gone through the DragTarget docs
tonight and having been confused.
I also changed one reference to (deprecated) onWillAccept
to onWillAcceptWithDetails.
The other changes to remove ! are just from
dart fixrunningautomatically in my editor. It appears that the modern analyzer
is smart enough to not need the !. I'm happy to revert those if
Flutter is intentionally not running
dart fixon files.Fixes #151448
Pre-launch Checklist
///).