pub enum ToolbarMorph {}Expand description
The expand ramp’s pure geometry: what the bar’s expand progress does to the
adjacent FAB’s square and to the revealing pill’s opacity — an uninhabited
namespace type (no instance is ever constructed), the same shape
crate::MaterialSpring’s own token namespace uses.
use frust_material::ToolbarMorph;
// Collapsed is the 80dp end; expanded the 56dp one.
assert_eq!(ToolbarMorph::size(0.0), 80.0);
assert_eq!(ToolbarMorph::size(1.0), 56.0);
assert_eq!(ToolbarMorph::size(0.5), 68.0);
// The spring's overshoot past 1 is real travel, never clamped away.
assert!(ToolbarMorph::size(1.1) < 56.0);
// …but never negative, whatever the input.
assert_eq!(ToolbarMorph::size(f64::NAN), 80.0);
// The pill stays invisible through the ramp's first half.
assert_eq!(ToolbarMorph::reveal_alpha(0.5), 0.0);
assert_eq!(ToolbarMorph::reveal_alpha(1.0), 1.0);Implementations§
Source§impl ToolbarMorph
impl ToolbarMorph
Sourcepub fn size(progress: f64) -> f64
pub fn size(progress: f64) -> f64
The FAB’s square at expand progress — _resolvedFabSize’s own
fabMedium + (fabBaseline - fabMedium) * progress, floored at zero and
NaN-mapped to the collapsed (resting) end.
Sourcepub fn reveal_alpha(progress: f64) -> f64
pub fn reveal_alpha(progress: f64) -> f64
The revealing pill’s opacity at expand progress — upstream’s
Interval(0.5, 1, curve: Curves.easeIn), whose control points
(Curve::EaseIn, cubic-bezier(0.42, 0, 1, 1)) are Flutter’s
Curves.easeIn exactly. See TOOLBAR_REVEAL_FADE_START.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ToolbarMorph
impl RefUnwindSafe for ToolbarMorph
impl Send for ToolbarMorph
impl Sync for ToolbarMorph
impl Unpin for ToolbarMorph
impl UnsafeUnpin for ToolbarMorph
impl UnwindSafe for ToolbarMorph
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
Convert
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>
Convert
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)
Convert
&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)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> StorageAccess<T> for T
impl<T> StorageAccess<T> for T
Source§fn as_borrowed(&self) -> &T
fn as_borrowed(&self) -> &T
Borrows the value.
Source§fn into_taken(self) -> T
fn into_taken(self) -> T
Takes the value.