TransformGesture class final
Makes the node pannable, zoomable and rotatable by touch, mouse and
trackpad (Flutter's InteractiveViewer, and more): pinch and
ctrl+wheel zoom about the focal point, one finger pans, two rotate, a
double tap zooms to a point; a release flings and settles by physics
within bounds and minScale–maxScale. The pose binds two-way to
variables (xVariable...); inside it reads as ${transform.x},
${transform.scale}... Each change runs the node's changed
reactions, the end of a gesture its changeEnd ones.
- Annotations
-
- @immutable
Constructors
- TransformGesture({bool enabled = true, TransformTarget target = TransformTarget.node, TransformPan pan = TransformPan.always, bool zoom = true, bool rotate = false, double minScale = 1, double maxScale = 4, GestureBounds bounds = GestureBounds.cover, double doubleTapScale = 2.5, WheelZoom wheel = WheelZoom.ctrlZoom, GesturePhysics? physics, String xVariable = '', String yVariable = '', String scaleVariable = '', String rotationVariable = '', String scaleXVariable = '', String scaleYVariable = '', TransformHandles? handles, double? x, double? y, double? scale, double? rotation, double? scaleX, double? scaleY})
-
const
Properties
- bounds → GestureBounds
-
final
- doubleTapScale → double
-
The scale a double tap zooms to (and back to minScale); 0 is off.
final
- effectivePhysics → GesturePhysics
-
no setter
- enabled → bool
-
Bindable as
transformGesture.enabled.final - handles → TransformHandles?
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- maxScale → double
-
Past either, the scale rubber-bands and springs back.
final
- minScale → double
-
Past either, the scale rubber-bands and springs back.
final
- pan → TransformPan
-
final
- physics → GesturePhysics?
-
Null for GesturePhysics.standard.
final
-
props
→ List<
Object?> -
no setter
- rotate → bool
-
Whether pinch, wheel and double tap zoom; two fingers rotate.
final
- rotation → double?
-
The pose given from data (bound as
transformGesture.x...), which the node springs to when it changes; null for the gesture's own.final - rotationVariable → String
-
Number variables holding the pose, two-way (a zoom slider).
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scale → double?
-
The pose given from data (bound as
transformGesture.x...), which the node springs to when it changes; null for the gesture's own.final - scaleVariable → String
-
Number variables holding the pose, two-way (a zoom slider).
final
- scaleX → double?
-
The pose given from data (bound as
transformGesture.x...), which the node springs to when it changes; null for the gesture's own.final - scaleXVariable → String
-
Number variables holding the pose, two-way (a zoom slider).
final
- scaleY → double?
-
The pose given from data (bound as
transformGesture.x...), which the node springs to when it changes; null for the gesture's own.final - scaleYVariable → String
-
Number variables holding the pose, two-way (a zoom slider).
final
- target → TransformTarget
-
final
- wheel → WheelZoom
-
final
- x → double?
-
The pose given from data (bound as
transformGesture.x...), which the node springs to when it changes; null for the gesture's own.final - xVariable → String
-
Number variables holding the pose, two-way (a zoom slider).
final
- y → double?
-
The pose given from data (bound as
transformGesture.x...), which the node springs to when it changes; null for the gesture's own.final - yVariable → String
-
Number variables holding the pose, two-way (a zoom slider).
final
- zoom → bool
-
Whether pinch, wheel and double tap zoom; two fingers rotate.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pansAt(
double scale) → bool -
Whether one finger may pan at
scale. (Two fingers pan with TransformPan.always, TransformPan.whenZoomed and TransformPan.multiTouch.) -
toJson(
) → Json -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
fromJson(
Object? json) → TransformGesture?