chore!: Remove deprecated old event classes with replacements - #3987
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Removes deprecated game-level tap/long-press detector APIs (and their legacy event info classes) now that replacement callback-based APIs are available, and updates tests/docs to align with the breaking change.
Changes:
- Removed deprecated
*TapDetector,DoubleTapDetector, andLongPressDetectormixins plus legacyLongPress*Infoevent wrappers. - Removed GameWidget gesture-recognizer wiring and tests that only existed to support those deprecated detectors.
- Added migration guidance and updated detector tests to use callback replacements (e.g.
DoubleTapCallbacks).
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/flame/test/gestures/detectors_test.dart | Drops deprecated detector coverage and updates remaining detector tests to use callback replacements where applicable. |
| packages/flame/test/game/game_widget/game_widget_tap_test.dart | Removes tests that exclusively exercised deprecated tap/double-tap detector mixins. |
| packages/flame/lib/src/gestures/events.dart | Removes legacy LongPress*Info event wrapper classes that were only used by the deprecated detectors. |
| packages/flame/lib/src/gestures/detectors.dart | Removes deprecated tap/double-tap/long-press detector mixins. |
| packages/flame/lib/src/game/game_widget/gesture_detector_builder.dart | Removes gesture recognizer registration code paths that existed solely for deprecated detectors. |
| packages/flame/lib/src/game/flame_game.dart | Updates hit-testing logic/comments to reflect removal of deprecated game-level detector mixins. |
| packages/flame/lib/events.dart | Stops exporting removed deprecated detectors and legacy long-press info wrappers. |
| doc/flame/migration.md | Documents the breaking removal and maps removed APIs to their replacements. |
| doc/flame/inputs/gesture_input.md | Removes the deprecated tap/long-press detectors from the listed detector taxonomy. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.
Suppressed comments (1)
packages/flame/lib/src/game/flame_game.dart:251
FlameGame.containsEventHandlerAtis used for hit-testing whenGameWidgetis notHitTestBehavior.opaque(seeGameRenderBox.hitTestSelf). After removing the deprecated game-level tap/long-press detectors, the replacement mixinsLongPressCallbacksandTertiaryTapCallbacksstill aren't recognized in the component scan below, so the widget can fail hit-testing and stop receiving pointer events even when those callbacks are present at the tapped point (or on the game itself).
bool containsEventHandlerAt(Vector2 position) {
// Game-level detector mixins handle events for the entire game surface,
// so any in-bounds point is a hit.
if (this is VerticalDragDetector ||
this is HorizontalDragDetector ||
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
Remove deprecated old event classes, all with replacements already in place.
Checklist
docsand added dartdoc comments with///.examplesordocs.Breaking Change?