gestures library

Classes

AnchorContext
Inputs supplied to Overrides.anchor when computing the rect's center during a drag with DragGesture.scaleResponse.
AttractSettle
Settle via critically-damped SpringSimulation — attractor pulls rect to target (force ∝ displacement). Starts slow, accelerates, lands smoothly with no overshoot. stiffness controls snap speed; damping is auto-tuned to critical.
Bounds
Shared base for bound configurations.
CropConfig
Cropper tool configuration. Attached to a DisplayConfig via DisplayConfig.crop. When non-null in the active mode's DisplayConfig, the Cropper widget renders crop UI and applies these constraints when the user manipulates the crop rect.
Decay
Release-time decay model. Produces a Flutter Simulation for the rect's post-gesture motion given a starting position and velocity. Origin reads x(t), dx(t), isDone(t) on the returned simulation — anything that conforms to Simulation plugs in (friction, spring, custom).
DecayConfig
Per-state release-time decay model.
DisplayConfig
Override config applied while an Origin is displayed (active on stage).
DragBounds
DragGesture
ExpandBounds
ExponentialDecay
Exponential velocity decay via FrictionSimulation.
Friction
Resistance to motion during an active gesture, as a function of progress through a bound state. Range 0, 1: 0 = no resistance, 1 = block.
FrictionConfig
Per-state friction during an active gesture.
Gesture
Sealed parent for gesture kinds.
GestureBounds
Per-direction container of DragBounds for a gesture's four sides. Replaces the old Map<DragBound, DragBounds> so the API stays const-constructible, type-safe, and ships named shortcuts for the common shapes. Use at for enum-keyed lookups inside physics code.
GestureConstraints
GestureStart
Sealed parent for gesture-start enums. Pattern-match exhaustiveness on DragStart vs ScaleStart is guaranteed.
Overrides
Stage/Origin-level escape hatches for advanced behavioral overrides. Fields are reserved for power-user customizations; defaults are correct for typical use.
ScaleGesture
ScaleRamp
One zone of a ScaleResponse. Maps a normalized progress (0..1 across that zone's drag travel) to a scale factor that ends at end via curve. The zone's start value is implicit (taken from the prior zone's end, or 1.0 at base for the first zone) so consecutive ramps are guaranteed continuous.
ScaleResponse
Scale-as-function-of-drag-progress, split into two zones:
Settle
Rubber-back settle model. Produces a Flutter Simulation that starts at the decay's end position and velocity, and lands at the target. Origin renders the motion via the returned simulation, giving velocity continuity with the decay phase.
ShrinkBounds
StageTapEvent
Inputs passed to OnStageTap when the displayed view receives a single- or double-tap. Carries the tap position plus the current/base/display rects at the moment of the tap.
TapEvent

Enums

DragBound
DragHybrid
How a Stage receives pointer additions while an Origin is dragging. Cascade: per-gesture > per-Origin > per-Stage > lock default.
DragPromote
What Stage does in displayed state when a 2nd pointer is added while a DragGesture is the active gesture. Cascade: per-gesture > per-displayConfig
DragStart
ScaleHybrid
How a Stage receives pointer additions while an Origin is scaling. Cascade: per-gesture > per-Origin > per-Stage > lock default.
ScaleStart

Typedefs

ActiveGesture = ({Gesture gesture, GestureStart start})
A committed gesture: the matched key (start) and value (gesture).
OnStageTap = void Function(StageTapEvent event)
Signature for displayed-state tap/double-tap handlers — both carry the same StageTapEvent payload.
OriginGesture = ({ActiveGesture active, DragHybrid? dragHybrid, OnRelease? onRelease, Map<ScaleStart, ScaleGesture>? scale, ScaleHybrid? scaleHybrid, double? scaleVelocityCancel})
An Origin-level gesture currently in flight, surfaced to StageData so Stage can decide what to do with new pointers (see DragHybrid / ScaleHybrid). The hybrid fields are partially-resolved — Origin folds in gesture-level + Origin-level, Stage finishes with its own fallback and the package default.
StageBuilder = Widget Function(BuildContext context, Widget child)
StageTap = void Function(TapEvent event)