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
impl Split
Sourcepub fn new(
split: f64,
begin_curve: Rc<dyn Curve>,
end_curve: Rc<dyn Curve>,
) -> Split
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.
Sourcepub const fn split(&self) -> f64
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.
Sourcepub fn begin_curve(&self) -> &Rc<dyn Curve>
pub fn begin_curve(&self) -> &Rc<dyn Curve>
The curve to use before split is reached.