Skip to content

Conversation

@xu-baolin
Copy link
Member

@xu-baolin xu-baolin commented Jan 7, 2021

Context addresses #13101 (comment) and #13102

Adding pointerCount property to scale gesture details is useful for developers. Use it to distinguish the scale caused by pan(one finger) and zoom(more than one finger) gesture.

CC @Hixie

Fixes #13102
Fixes #49025

@xu-baolin xu-baolin requested a review from dkwingsmt January 7, 2021 11:19
@flutter-dashboard flutter-dashboard bot added the framework flutter/packages/flutter repository. See also f: labels. label Jan 7, 2021
@google-cla google-cla bot added the cla: yes label Jan 7, 2021
Copy link
Contributor

@dkwingsmt dkwingsmt left a comment

Choose a reason for hiding this comment

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

LGTM except for tiny format issues

///
/// The [velocity] argument must not be null.
ScaleEndDetails({ this.velocity = Velocity.zero })
ScaleEndDetails({ this.velocity = Velocity.zero, this.pointerCount = 0, })
Copy link
Contributor

@dkwingsmt dkwingsmt Jan 11, 2021

Choose a reason for hiding this comment

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

Suggested change
ScaleEndDetails({ this.velocity = Velocity.zero, this.pointerCount = 0, })
ScaleEndDetails({ this.velocity = Velocity.zero, this.pointerCount = 0 })

I've searched around the repo and have found 2 use cases of , }), including one in this file. It's safe to assume to be a typo.

///
/// The [focalPoint] argument must not be null.
ScaleStartDetails({ this.focalPoint = Offset.zero, Offset? localFocalPoint, })
ScaleStartDetails({ this.focalPoint = Offset.zero, Offset? localFocalPoint, this.pointerCount = 0, })
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
ScaleStartDetails({ this.focalPoint = Offset.zero, Offset? localFocalPoint, this.pointerCount = 0, })
ScaleStartDetails({ this.focalPoint = Offset.zero, Offset? localFocalPoint, this.pointerCount = 0 })

@flutter-dashboard flutter-dashboard bot added the f: material design flutter/packages/flutter/material repository. label Jan 12, 2021
@fluttergithubbot fluttergithubbot merged commit 32dc1b7 into flutter:master Jan 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

single finger scale gesture Gesture detector scale and pan should work together

4 participants