pub struct ClampingScrollSimulation { /* private fields */ }Expand description
A fling that decelerates like Android’s OverScroller, then stops dead.
The curve is the one Android’s SplineOverScroller uses for a fling: distance
and duration are derived from the release velocity, and the position follows
1 − (1 − t)^r over that duration. It never leaves the content: reaching
an edge is the caller’s business (see the clamping scroll policy), which is
what makes it the right model for a platform with no bounce.
Adjusted, as Flutter’s is, to be ballistic — deceleration depends only on the current velocity, never on how long ago the motion started — so a fling can be restarted mid-flight from its own state alone.
Implementations§
Source§impl ClampingScrollSimulation
impl ClampingScrollSimulation
Sourcepub fn new(position: f32, velocity: f32, tolerance: Tolerance) -> Self
pub fn new(position: f32, velocity: f32, tolerance: Tolerance) -> Self
A fling from position at velocity (px/s), with Android’s friction.
Trait Implementations§
Source§impl Clone for ClampingScrollSimulation
impl Clone for ClampingScrollSimulation
impl Copy for ClampingScrollSimulation
Source§impl Debug for ClampingScrollSimulation
impl Debug for ClampingScrollSimulation
Source§impl Simulation for ClampingScrollSimulation
impl Simulation for ClampingScrollSimulation
Auto Trait Implementations§
impl Freeze for ClampingScrollSimulation
impl RefUnwindSafe for ClampingScrollSimulation
impl Send for ClampingScrollSimulation
impl Sync for ClampingScrollSimulation
impl Unpin for ClampingScrollSimulation
impl UnsafeUnpin for ClampingScrollSimulation
impl UnwindSafe for ClampingScrollSimulation
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more