Skip to main content

Split

Struct Split 

Source
pub struct Split { /* private fields */ }
Expand description

A curve that progresses according to begin_curve until split, then according to end_curve.

Split curves are useful in situations where a widget must track the user’s finger (which requires a linear animation), but can also be flung using a curve specified with the end_curve argument, after the finger is released. In such a case, the value of split would be the progress of the animation at the time when the finger was released.

For example, if split is set to 0.5, begin_curve is Curves::linear, and end_curve is Curves::ease_out_cubic, then the bottom-left quarter of the curve will be a straight line, and the top-right quarter will contain the entire Curves::ease_out_cubic curve.

Implementations§

Source§

impl Split

Source

pub fn new( split: f64, begin_curve: Rc<dyn Curve>, end_curve: Rc<dyn Curve>, ) -> Split

Creates a split curve.

Dart defaults begin_curve to Curves::linear and end_curve to Curves::ease_out_cubic.

Source

pub const fn split(&self) -> f64

The progress value separating begin_curve from end_curve.

The value before which the curve progresses according to begin_curve and after which the curve progresses according to end_curve.

When t is exactly split, the curve has the value split.

Must be between 0 and 1.0, inclusively.

Source

pub fn begin_curve(&self) -> &Rc<dyn Curve>

The curve to use before split is reached.

Source

pub fn end_curve(&self) -> &Rc<dyn Curve>

The curve to use after split is reached.

Trait Implementations§

Source§

impl Curve for Split

Source§

fn transform(&self, t: f64) -> f64

Returns the value of the curve at point t. Read more
Source§

fn transform_internal(&self, _t: f64) -> f64

Returns the value of the curve at point t. Read more
Source§

impl Debug for Split

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Split

§

impl !Send for Split

§

impl !Sync for Split

§

impl !UnwindSafe for Split

§

impl Forget for Split

§

impl Freeze for Split
where *const RcInner<dyn Curve> is !null: Freeze, PhantomData<RcInner<dyn Curve>>: Freeze,

§

impl Move for Split

§

impl Unpin for Split
where Rc<dyn Curve>: Unpin,

§

impl UnsafeUnpin for Split
where *const RcInner<dyn Curve> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Curve>>: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>