DragGesture class

Inheritance

Constructors

DragGesture({GestureBounds bounds = const GestureBounds(), GestureConstraints? constraints, StageBuilder? builder, OnRelease? onRelease, double? scaleVelocityCancel, DragGesture? override(Rect startRect, Rect baseRect)?, DragHybrid? hybridFromStage, DragPromote? promote})
const

Properties

bounds → GestureBounds
Directional bounds active during this gesture (drag) or directional overflow during scale (rect edges past container edges).
finalinherited
builder → StageBuilder?
finalinherited
constraints → GestureConstraints?
finalinherited
hashCode → int
The hash code for this object.
no setterinherited
hybridFromStage → DragHybrid?
Per-gesture override for how Stage receives new pointers while this drag is active. Cascades up to Origin.dragHybridFromStage → Stage.dragHybridFromStage → DragHybrid.lock when null.
final
onRelease → OnRelease?
Called when the gesture ends with a ReleaseContext — raw end-state inputs. Consumer calls Stage.of(context).release(Release.toDisplay(data)) for the default plan, or builds a custom plan and calls .run(...) / .backToOrigin(data) / etc.
finalinherited
override → DragGesture? Function(Rect startRect, Rect baseRect)?
Optional resolver invoked at gesture commit. Receives the rect at gesture start and the base rect; returns the DragGesture to actually use for the rest of the gesture (or null to keep this one). Lets consumers pick a different variant based on starting rect state — e.g., shrink-on-drag only when starting at base; plain translation otherwise.
final
promote → DragPromote?
Per-gesture override for displayed-state drag→scale promotion when a 2nd pointer is added. Cascades up to DisplayConfig.dragPromote → Stage.dragPromote → DragPromote.scale when null.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
scaleVelocityCancel → double?
Per-gesture strength of scale-velocity-based translation cancellation in [0, 1]. Cascade fallback when null: DisplayConfig.scaleVelocityCancel → Origin.scaleVelocityCancel → Stage.scaleVelocityCancel → 0.5. Most relevant on ScaleGesture; a no-op on DragGesture since scaleVelocity is ~0 there.
finalinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited