pub struct AnimationStyle {
pub curve: Option<Rc<dyn Curve>>,
pub duration: Option<Duration>,
pub reverse_curve: Option<Rc<dyn Curve>>,
pub reverse_duration: Option<Duration>,
}Expand description
Used to override the default parameters of an animation.
If duration and reverse_duration are set to Duration::ZERO, the
corresponding animation will be disabled.
All of the parameters are optional. If no parameters are specified, the default animation will be used.
Fields§
§curve: Option<Rc<dyn Curve>>When specified, the animation will use this curve.
duration: Option<Duration>When specified, the animation will use this duration.
reverse_curve: Option<Rc<dyn Curve>>When specified, the reverse animation will use this curve.
reverse_duration: Option<Duration>When specified, the reverse animation will use this duration.
Implementations§
Source§impl AnimationStyle
impl AnimationStyle
Sourcepub const NO_ANIMATION: AnimationStyle
pub const NO_ANIMATION: AnimationStyle
An AnimationStyle with no animation.
Dart’s AnimationStyle.noAnimation.
Sourcepub fn new(
curve: Option<Rc<dyn Curve>>,
duration: Option<Duration>,
reverse_curve: Option<Rc<dyn Curve>>,
reverse_duration: Option<Duration>,
) -> AnimationStyle
pub fn new( curve: Option<Rc<dyn Curve>>, duration: Option<Duration>, reverse_curve: Option<Rc<dyn Curve>>, reverse_duration: Option<Duration>, ) -> AnimationStyle
Creates an instance of Animation Style class.
Sourcepub fn copy_with(
&self,
curve: Option<Rc<dyn Curve>>,
duration: Option<Duration>,
reverse_curve: Option<Rc<dyn Curve>>,
reverse_duration: Option<Duration>,
) -> AnimationStyle
pub fn copy_with( &self, curve: Option<Rc<dyn Curve>>, duration: Option<Duration>, reverse_curve: Option<Rc<dyn Curve>>, reverse_duration: Option<Duration>, ) -> AnimationStyle
Creates a new AnimationStyle based on the current selection, with
the provided parameters overridden.
Sourcepub fn merge(&self, other: Option<&AnimationStyle>) -> AnimationStyle
pub fn merge(&self, other: Option<&AnimationStyle>) -> AnimationStyle
Creates a new AnimationStyle that is a combination of this
animation style and the given other animation style.
If other is Some, its non-None properties are used to override
the corresponding properties of this style.
Returns this animation style if other is None.
Sourcepub fn lerp(
a: Option<&AnimationStyle>,
b: Option<&AnimationStyle>,
t: f64,
) -> Option<AnimationStyle>
pub fn lerp( a: Option<&AnimationStyle>, b: Option<&AnimationStyle>, t: f64, ) -> Option<AnimationStyle>
Linearly interpolate between two animation styles.
Trait Implementations§
Source§impl Clone for AnimationStyle
impl Clone for AnimationStyle
Source§fn clone(&self) -> AnimationStyle
fn clone(&self) -> AnimationStyle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AnimationStyle
impl Debug for AnimationStyle
Source§impl Default for AnimationStyle
impl Default for AnimationStyle
Source§fn default() -> AnimationStyle
fn default() -> AnimationStyle
impl Eq for AnimationStyle
Source§impl Hash for AnimationStyle
impl Hash for AnimationStyle
Auto Trait Implementations§
impl !RefUnwindSafe for AnimationStyle
impl !Send for AnimationStyle
impl !Sync for AnimationStyle
impl !UnwindSafe for AnimationStyle
impl Forget for AnimationStyle
impl Freeze for AnimationStyle
impl Move for AnimationStyle
impl Unpin for AnimationStyle
impl UnsafeUnpin for AnimationStylewhere
*const RcInner<dyn Curve> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Curve>>: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> AnyEq for T
impl<T> AnyEq for T
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.