Skip to content

Add [pointerCount] property to Scale Gesture Details - #73474

Merged
fluttergithubbot merged 4 commits into
flutter:masterfrom
xu-baolin:010601scale
Jan 12, 2021
Merged

fluttergithubbot merged 4 commits into
flutter:masterfrom
xu-baolin:010601scale

Conversation

@xu-baolin

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

Copy link
Copy Markdown
Member

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
Comment thread packages/flutter/lib/src/gestures/scale.dart
Comment thread packages/flutter/lib/src/gestures/scale.dart
Comment thread packages/flutter/lib/src/gestures/scale.dart

@dkwingsmt dkwingsmt 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.

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, })

@dkwingsmt dkwingsmt Jan 11, 2021 •

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.

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
Copy Markdown
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 p: material_ui material_ui package in flutter/packages 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

framework flutter/packages/flutter repository. See also f: labels. p: material_ui material_ui package in flutter/packages

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