chore!: Kill PanDetector and the old event system - #4031
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Removes the legacy PanDetector event system in favor of component-based callback APIs and consolidates input documentation.
Changes:
- Removes legacy gesture classes, exports, initialization, and tests.
- Adds
PanDetectormigration guidance. - Reorganizes input documentation and repairs links.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
packages/flame/test/gestures/detectors_test.dart |
Removes obsolete detector tests. |
packages/flame/test/game/game_widget/game_widget_drag_test.dart |
Removes legacy pan widget tests. |
packages/flame/lib/src/gestures/events.dart |
Deletes legacy event wrappers. |
packages/flame/lib/src/gestures/detectors.dart |
Deletes PanDetector. |
packages/flame/lib/src/game/game.dart |
Removes legacy gesture initialization. |
packages/flame/lib/src/game/game_widget/gesture_detector_builder.dart |
Removes detector wiring. |
packages/flame/lib/src/game/flame_game.dart |
Removes the PanDetector hit-test special case. |
packages/flame/lib/input.dart |
Removes the detector export. |
packages/flame/lib/events.dart |
Removes legacy gesture exports. |
doc/flame/migration.md |
Documents migration to DragCallbacks. |
doc/flame/inputs/tap_events.md |
Removes legacy API notice. |
doc/flame/inputs/scale_events.md |
Consolidates scale/drag and camera guidance. |
doc/flame/inputs/pointer_events.md |
Moves mouse cursor guidance here. |
doc/flame/inputs/other_inputs.md |
Removes redundant navigation. |
doc/flame/inputs/keyboard_input.md |
Removes redundant navigation. |
doc/flame/inputs/inputs.md |
Expands the input overview and coordinates guide. |
doc/flame/inputs/gesture_input.md |
Deletes the obsolete duplicate page. |
doc/flame/inputs/drag_events.md |
Links to canonical scale/drag guidance. |
doc/flame/collision_detection.md |
Repairs GestureHitboxes links. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
luanpotter
marked this pull request as ready for review
August 30, 2026 19:00
spydon
approved these changes
Aug 30, 2026
luanpotter
enabled auto-merge (squash)
August 30, 2026 19:13
6 tasks
luanpotter
added a commit
that referenced
this pull request
Aug 30, 2026
Followup on #4031 (comment), this aligns all previous tables on `migration.md` with spaces for (source) readability.
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.
Description
Kills
PanDetectorwhich was the last surviving heir of the game-level detectors. With it dead is all the infra:src/gestures/, includingevents.dartwithBaseInfo,PositionInfo,EventPosition,EventDeltaand all*Infoclasses (TapDownInfoandTapUpInfowere already dead but not cleansed);GestureDetectorBuilder.initializeGestures, which existed only to wire the detectors onto recognizers, along with the..initializeGestures(this)cascade onGame(this will allow some further simplifications on gesture builder binding);this is PanDetectorearly-return inFlameGame.containsEventHandlerAt(it was redundant, ascomponentsAtPointyields the game itself last, so aFlameGamewith a positional callbacks mixin is still reported as a hit anywhere within its bounds);events.dartandinput.dartbarrels.Old
PanDetectorusers should move toDragCallbacks(which as usual can be mixed intoFlameGamedirectly). The examples and tutorials were migrated separately in #4028.Also updates and restructure the entire events docs, with this last mercy kill:
gesture_input.mdis deleted (it had become a second index page duplicatinginputs.md, plus cross-cutting sections that I re-homed);inputs.md, the mouse cursor section topointer_events.md, and panning-and-zooming folds intoscale_events.md;collision_detection.mdpointed atinputs/gesture_input.md#gesturehitboxes, but that section had moved toinputs.mdin feat!: Kill MouseMovementDetector and rename PointerMove* to MouseMove* #4011 without its inbound links being updated;drag_events.mdandscale_events.mdcarrying byte-identical code blocks.scale_events.mdis now canonical anddrag_events.mdcross-links to it;tap_events.mdandpointer_events.md. There is no longer an old approach;keyboard_input.mdandother_inputs.md. They date from docs: Major docs redo #2063, wheninputs/held exactly three documents that each linked the other two; the gesture third has since become five pages, none of which ever got the block. No other doc grouping in the tree links back to its index or lists siblings (navigation is the toctree);localPosition/localDeltaare only valid inside the callback, withclone()as the escape hatch if you need the value later.The Breaking
PanDetector,DragDownInfo,DragStartInfo,DragUpdateInfo,DragEndInfo,TapDownInfo,TapUpInfo,PositionInfo,GestureDetectorBuilder.initializeGestureskilled; migration guide section is included.Checklist
docsand added dartdoc comments with///.examplesordocs.Breaking Change?