Skip to content
Boring Doc
BreakingHigh impactOfficial migration guidesince 2.5.0landed 2.3.0-13.0.pre

GestureRecognizer cleanup

Framework · Official source

`OneSequenceGestureRecognizer.addAllowedPointer()` was changed to take a `PointerDownEvent`, like its superclass. Previously, it accepted the more general `PointerEvent` type, which was incorrect.

Original behavior

The framework only ever passes `PointerDownEvent` objects to `addAllowedPointer()`. Declaring `OneSequenceGestureRecognizer.addAllowedPointer()` to take the more general type was confusing, and caused `OneSequenceGestureRecognizer` subclasses to have to cast their argument to the right class.

New behavior

The previous declaration forced `OneSequenceGestureRecognizer` descendants to override `addAllowedPointer()` like so:

Who is affected
Applications and packages relying on the previous behaviour or signature. Code that uses PointerDownEvent, PointerEvent, OneSequenceGestureRecognizer.
Practical impact
Behaviour or API differences that can break builds or change runtime behaviour.
What action should I take?
Follow the official migration guide below, update affected call sites, run `dart fix --apply` where a fix is available, then run your tests.

Before and after (from the official guide)

dart+1−1
Before
1 class CustomGestureRecognizer extends ScaleGestureRecognizer {
2 @override
3− void addAllowedPointer(PointerEvent event) {
4 // insert custom handling of event here...
5 super.addAllowedPointer(event);
6 }
7 }
After
1 class CustomGestureRecognizer extends ScaleGestureRecognizer {
2 @override
3+ void addAllowedPointer(PointerDownEvent event) {
4 // insert custom handling of event here...
5 super.addAllowedPointer(event);
6 }
7 }
Raw before / after
class CustomGestureRecognizer extends ScaleGestureRecognizer {
  @override
  void addAllowedPointer(PointerEvent event) {
    // insert custom handling of event here...
    super.addAllowedPointer(event);
  }
}
class CustomGestureRecognizer extends ScaleGestureRecognizer {
  @override
  void addAllowedPointer(PointerDownEvent event) {
    // insert custom handling of event here...
    super.addAllowedPointer(event);
  }
}
Official migration guide (excerpt, © The Flutter Authors, CC BY 3.0)

Code before migration:

class CustomGestureRecognizer extends ScaleGestureRecognizer {
  @override
  void addAllowedPointer(PointerEvent event) {
    // insert custom handling of event here...
    super.addAllowedPointer(event);
  }
}

Code after migration:

class CustomGestureRecognizer extends ScaleGestureRecognizer {
  @override
  void addAllowedPointer(PointerDownEvent event) {
    // insert custom handling of event here...
    super.addAllowedPointer(event);
  }
}
Migration assistantAI-generated · grounded in cited sources
AI explanations are not configured
Set AI_PROVIDER (for example to openai-compatible with a local Ollama or LM Studio endpoint) to enable grounded explanations. Everything else on this page works without an AI provider.
Official migration guide·Verified classification (95%)

Listed in the official breaking-changes index (docs.flutter.dev/release/breaking-changes).

An official announcement or migration guide documents an intended behaviour or API change. A verified source change (git diff) shows code changed but does not by itself prove a public API is breaking. AI interpretations are labelled and never used to classify a change.

Source commit
b3045439b7c0
Source last updated
Oct 21, 2026
Last synchronized
Oct 21, 2026
Publication status
published
Publication history
  • Oct 21, 2026, 8:31 PM: new → published (ingestion) — Backed by an official breaking-change/migration guide.
AI explanationAI-generated · grounded in cited sources
AI explanations are not configured
Set AI_PROVIDER (for example to openai-compatible with a local Ollama or LM Studio endpoint) to enable grounded explanations. Everything else on this page works without an AI provider.
Was this useful?