Add hit-test position selector#118
Merged
Merged
Conversation
passsy
commented
Jun 16, 2025
passsy
commented
Jun 16, 2025
There was a problem hiding this comment.
Pull Request Overview
This PR adds utilities to select multiple widgets at a given screen position.
- Introduce a
PositionFilterandPositionSelectorsextension to hit-test widgets by global coordinates - Remove the old singular selector and expose the new
spotWidgetsAtPositionin the public API - Update tests and changelog to reflect the new plural selector
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| test/spot/widget_at_position_test.dart | Adapted tests to use spotWidgetsAtPosition and added new cases |
| lib/src/spot/selectors.dart | Imported PositionFilter and added PositionSelectors extension |
| lib/src/spot/filters/position_filter.dart | Implemented widget hit-testing logic via PositionFilter |
| lib/spot.dart | Exposed top-level spotWidgetsAtPosition and exported PositionFilter |
| CHANGELOG.md | Bumped to 0.18.1 and documented the new selector |
Comments suppressed due to low confidence (1)
test/spot/widget_at_position_test.dart:49
- [nitpick] Consider adding a test case where
spotWidgetsAtPositionis called at a point with no widgets (e.g., outside the stack) to ensure it returns an empty result.
}
9269110 to
42d8dde
Compare
27ce2df to
64befdc
Compare
64befdc to
f97e2a7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds hit-test based position selectors for widgets at a global screen coordinate.
spotAtPositionstarts a selector from a global position.atPositionnarrows an existing selector by the Flutter hit-test path.The selectors follow Flutter hit testing, so overlapping siblings that do not receive the hit are not reported.
Fixes #28