Skip to content

get the number of pointers in ScaleGestureRecognizer's handleEvent #127309

@kseino

Description

@kseino

Is there an existing issue for this?

Use case

we have a use case to handle pointer event, depending on the number of pointers in the ScaleGestureRecognizer's handleEvent.
do we have any way to get the number of pointers?

class CustomScaleGestureRecognizer extends ScaleGestureRecognizer {
  @override void handleEvent(PointerEvent event) {
    super.handleEvent(event);
    // handle only when two-fingered.
  }
}

Proposal

class CustomScaleGestureRecognizer extends ScaleGestureRecognizer {
  @override void handleEvent(PointerEvent event) {
    super.handleEvent(event);
    if (pointerCount == 2) {
      // do something
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectc: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Flutterf: gesturesflutter/packages/flutter/gestures repository.frameworkflutter/packages/flutter repository. See also f: labels.waiting for customer responseThe Flutter team cannot make further progress on this issue until the original reporter responds

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions