Expand description
Pure input/gesture helpers (slop constants, input::VelocityTracker, the
fling-decay math) re-exported for app authors and advanced widgets.
Structs§
- Velocity
Tracker - A ring of recent
(time_ms, position)samples used to estimate the release velocity of a drag for flinging.
Constants§
- FLING_
DECAY - Per-millisecond exponential fling decay factor (iOS “normal” deceleration):
v(t) = v0 · FLING_DECAY.powf(t_ms). - FLING_
STOP - Fling stop threshold, in px/s (~0.5 px/frame at 60 Hz): below this speed a fling is finished and the animation stops requesting frames.
- MOUSE_
SLOP - Mouse drag threshold (kept smaller than
TOUCH_SLOPbecause a mouse is far more precise). Reserved for when events carry an input-kind flag; v1 widgets useTOUCH_SLOPuniformly. - TOUCH_
SLOP - Touch drag threshold: how far a contact may move before a press becomes a drag/scroll (Flutter’s tap-vs-drag slop, 18 logical px).
- VELOCITY_
WINDOW_ MS - Trailing window, in milliseconds, over which
VelocityTrackerestimates velocity — older samples are pruned. - WHEEL_
LINE_ PX - Logical pixels per wheel line — the constant a
LineDeltawheel notch is multiplied by to get a pixel scroll amount (a sane cross-toolkit value).
Functions§
- fling_
decay - Velocity of
v0afterelapsed_msof exponential fling decay. - fling_
displacement - Closed-form displacement (in px) travelled by a fling of initial velocity
v0(px/s) overelapsed_msmilliseconds.