Skip to content

Conversation

@eseidel
Copy link
Contributor

@eseidel eseidel commented Jul 9, 2024

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 fix 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 fix on files.

Fixes #151448

Pre-launch Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • I signed the [CLA].
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is [test-exempt].
  • I followed the [breaking change policy] and added [Data Driven Fixes] where supported.
  • All existing and new tests are passing.

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.
@flutter-dashboard
Copy link

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.

@github-actions github-actions bot added the framework flutter/packages/flutter repository. See also f: labels. label Jul 9, 2024
@eseidel eseidel requested a review from justinmc July 9, 2024 03:36
/// 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
Copy link
Contributor

@aliasgar4558 aliasgar4558 Jul 9, 2024

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].

Copy link
Contributor

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?

Copy link
Contributor Author

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// `candidateData`, if they return false, the data will appear in
/// `candidateData`, if both return false, the data will appear in

@dkwingsmt
Copy link
Contributor

Omitting the ! seems to have caused analyze errors. I guess it can't be removed after all.

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
error • The argument type 'Offset?' can't be assigned to the parameter type 'Offset'. • packages/flutter/lib/src/widgets/drag_target.dart:785:94 • argument_type_not_assignable
error • The argument type 'Offset?' can't be assigned to the parameter type 'Offset'. • packages/flutter/lib/src/widgets/drag_target.dart:793:79 • argument_type_not_assignable
error • The argument type 'Offset?' can't be assigned to the parameter type 'Offset'. • packages/flutter/lib/src/widgets/drag_target.dart:963:48 • argument_type_not_assignable

@dkwingsmt
Copy link
Contributor

test-exempt: documentation change with no semantic changes

Copy link
Contributor

@justinmc justinmc left a 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
Copy link
Contributor

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?

@eseidel eseidel requested a review from justinmc July 9, 2024 20:27
@eseidel
Copy link
Contributor Author

eseidel commented Jul 9, 2024

Fixes applied, PTAL.

Copy link
Contributor

@justinmc justinmc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 24, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 24, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 25, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 25, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 25, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 25, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 25, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 26, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 26, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 26, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 26, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 27, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 27, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 28, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jul 28, 2024
TytaniumDev pushed a commit to TytaniumDev/flutter that referenced this pull request Aug 7, 2024
Clarifications and changing a reference to a deprecated member.
Buchimi pushed a commit to Buchimi/flutter that referenced this pull request Sep 2, 2024
Clarifications and changing a reference to a deprecated member.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DragTarget docs could be improved

4 participants