Skip to content

chore!: Remove deprecated old event classes with replacements - #3987

Merged
luanpotter merged 2 commits into
mainfrom
luan.kill-the-old
Aug 7, 2026
Merged

chore!: Remove deprecated old event classes with replacements#3987
luanpotter merged 2 commits into
mainfrom
luan.kill-the-old

Conversation

@luanpotter

Copy link
Copy Markdown
Member

Description

Remove deprecated old event classes, all with replacements already in place.

Checklist

  • I have followed the Contributor Guide when preparing my PR.
  • I have updated/added tests for ALL new/updated/fixed functionality.
  • I have updated/added relevant documentation in docs and added dartdoc comments with ///.
  • I have updated/added relevant examples in examples or docs.

Breaking Change?

  • Yes, this PR is a breaking change.
  • No, this PR is not a breaking change.

@luanpotter
luanpotter marked this pull request as ready for review August 7, 2026 04:51
@luanpotter
luanpotter requested review from spydon and a lite review from Copilot August 7, 2026 04:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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, and LongPressDetector mixins plus legacy LongPress*Info event 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.

Comment thread doc/flame/inputs/gesture_input.md

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.containsEventHandlerAt is used for hit-testing when GameWidget is not HitTestBehavior.opaque (see GameRenderBox.hitTestSelf). After removing the deprecated game-level tap/long-press detectors, the replacement mixins LongPressCallbacks and TertiaryTapCallbacks still 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 ||

@spydon spydon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Lgtm!

@luanpotter
luanpotter merged commit 619d7b5 into main Aug 7, 2026
9 checks passed
@luanpotter
luanpotter deleted the luan.kill-the-old branch August 7, 2026 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants