feat: Support allowsMultiPointerDrag on DragCallbacks - #4033
Merged
Conversation
luanpotter
force-pushed
the
luan.multi-fingering
branch
from
August 30, 2026 20:28
71619f3 to
3f0bc8d
Compare
luanpotter
marked this pull request as ready for review
August 30, 2026 20:28
Contributor
There was a problem hiding this comment.
Pull request overview
Adds opt-in single-pointer drag handling to simplify components managing shared state.
Changes:
- Adds
allowsMultiPointerDragwith propagation and scale-event compatibility. - Adds comprehensive drag-dispatch tests and documentation.
- Migrates three examples from manual pointer tracking.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
drag_callbacks.dart |
Defines the new public option. |
multi_drag_scale_dispatcher.dart |
Gates concurrent drag starts. |
drag_callbacks_test.dart |
Tests gating, cleanup, propagation, and scaling. |
drag_events.md |
Documents usage and behavior. |
game.dart |
Simplifies ship drag control. |
particles_interactive_example.dart |
Simplifies emitter drag control. |
camera_component_example.dart |
Simplifies magnifier drag control. |
💡 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>
spydon
approved these changes
Aug 31, 2026
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
Add support for a
allowsMultiPointerDragonDragCallbacks, for easy of use for components that would break under multiple concurrent drags.When a drag controls the component itself, or a camera for panning, initiating a multi-fingered interaction might cause an elated state on the component, which might or might not be desirable depending on circumstances. Many existing examples were fixed as part of the new system migration (#4028; as per requested by Copilot), but all with ad-hoc code that Flame could vastly simplify. Note that is is not to discourage two-, three- or even five-fingered manipulations; but rather just to empower users to choose what feels best for their application.
Checklist
docsand added dartdoc comments with///.examplesordocs.Breaking Change?