pub struct SwipeDismissState { /* private fields */ }Expand description
A row’s swipe, as the application can see it.
A dismissable row is not only a callback: an application shows a delete label that fades in with the swipe, a counter of what is about to go, or an undo bar once a row has left. All of that needs the swipe itself, not just its ending, so the same state the widget drives is readable from outside it.
Cloning shares one row’s state. Hold it with rememberSwipeDismissState
and hand it to SwipeToDismissSpec::with_state.
Implementations§
Source§impl SwipeDismissState
impl SwipeDismissState
Sourcepub fn offset(&self) -> f32
pub fn offset(&self) -> f32
How far the row is displaced, in logical pixels: positive towards the start edge, negative towards the end. Reactive.
Sourcepub fn progress(&self) -> f32
pub fn progress(&self) -> f32
How far through a dismissal the row is, in 0..=1, against the same
threshold a release is judged by. 1.0 means letting go now dismisses.
Zero before the row has been measured — a fraction of an unknown width would be a guess.
Sourcepub fn side(&self) -> Option<SwipeDismissSide>
pub fn side(&self) -> Option<SwipeDismissSide>
The edge the background is revealed on, or None while the row is at
rest and no edge is showing.
Sourcepub fn is_displaced(&self) -> bool
pub fn is_displaced(&self) -> bool
Whether the row is away from rest — dragged, springing back, or leaving. Reactive.
Sourcepub fn is_dismissed(&self) -> bool
pub fn is_dismissed(&self) -> bool
Whether this row has been dismissed. Reactive.
Trait Implementations§
Source§impl Clone for SwipeDismissState
impl Clone for SwipeDismissState
Source§fn clone(&self) -> SwipeDismissState
fn clone(&self) -> SwipeDismissState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for SwipeDismissState
impl !Send for SwipeDismissState
impl !Sync for SwipeDismissState
impl !UnwindSafe for SwipeDismissState
impl Freeze for SwipeDismissState
impl Unpin for SwipeDismissState
impl UnsafeUnpin for SwipeDismissState
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.