Pan class final
Follows the pointer (node key pan): GestureDetector(onPanUpdate:)
moving a Transform.translate. On release it springs back to rest or
stays (release), with physics a fling that slows by friction, a
spring and snap points within bounds and the limits minX...maxY
(a bottom sheet: {"axis": "vertical", "release": "stay", "minY": -560, "maxY": 0, "physics": {"snap": {"points": [[0, 0], [0, -560]]}}}).
Its offset binds two-way to xVariable and yVariable; x and y
(bindable) place its rest.
Inside it ${pan.dx}, ${pan.dy}, ${pan.dragging},
${pan.settling}, ${pan.snapIndex} can be read (and the same as
${drag.*}). It fires drag and dragEnd.
- Annotations
-
- @immutable
Constructors
- Pan({bool enabled = true, DragAxis axis = DragAxis.free, PanRelease release = PanRelease.snapBack, int returnDuration = 450, AnimationCurve returnCurve = AnimationCurve.spring, double x = 0, double y = 0, String xVariable = '', String yVariable = '', GesturePhysics? physics, GestureBounds bounds = GestureBounds.none, double? minX, double? maxX, double? minY, double? maxY})
-
const
Properties
- axis → DragAxis
-
The axis it moves on (
Draggable.axis,InteractiveViewer.panAxis).final - bounds → GestureBounds
-
What it's kept inside of while dragged and flung, narrowed by the
offsets from rest minX...maxY (null: no limit).
final
- enabled → bool
-
Bindable as
pan.enabled.final - hasBounds → bool
-
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- maxX → double?
-
final
- maxY → double?
-
final
- minX → double?
-
final
- minY → double?
-
final
- physics → GesturePhysics?
-
How it moves on its own after release (a fling, a spring settle, snap
points, overscroll); null returns over returnDuration.
final
-
props
→ List<
Object?> -
no setter
- release → PanRelease
-
final
- returnCurve → AnimationCurve
-
final
- returnDuration → int
-
The spring back to rest without physics (ms and curve).
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- x → double
-
Where it rests, from where its layout puts it (pixels; bindable as
pan.x,pan.y): it springs back here, and a new value moves it.final - xVariable → String
-
Number variables its offset from where its layout puts it is written
to (rounded to hundredths) as it moves.
final
- y → double
-
Where it rests, from where its layout puts it (pixels; bindable as
pan.x,pan.y): it springs back here, and a new value moves it.final - yVariable → String
-
Number variables its offset from where its layout puts it is written
to (rounded to hundredths) as it moves.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Json -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited