Skip to main content

MatrixTransition

Struct MatrixTransition 

Source
pub struct MatrixTransition {
    pub key: Option<KeyRef>,
    pub on_transform: TransformCallback,
    pub animation: AnimationRef<f64>,
    pub alignment: Alignment,
    pub filter_quality: Option<FilterQuality>,
    pub child: Option<WidgetRef>,
}
Expand description

Animates the Matrix4 of a transformed widget.

The on_transform callback computes a Matrix4 from the animated value, it is called every time the animation changes its value.

See also:

  • ScaleTransition, which animates the scale of a widget, by providing a matrix which scales along the X and Y axis.
  • RotationTransition, which animates the rotation of a widget, by providing a matrix which rotates along the Z axis.

Fields§

§key: Option<KeyRef>§on_transform: TransformCallback

The callback to compute a Matrix4 from the animation. It’s called every time animation changes its value.

§animation: AnimationRef<f64>

The animation that controls the matrix of the child.

The matrix will be computed from the animation with the on_transform callback.

§alignment: Alignment

The alignment of the origin of the coordinate system in which the transform takes place, relative to the size of the box.

For example, to set the origin of the transform to bottom middle, you can use an alignment of (0.0, 1.0).

§filter_quality: Option<FilterQuality>

The filter quality with which to apply the transform as a bitmap operation.

When the animation is stopped (either in AnimationStatus::Dismissed or AnimationStatus::Completed), the filter quality argument will be ignored.

The transform will be applied by re-rendering the child if filter_quality is None, otherwise it controls the quality of an ImageFilter.matrix applied to a bitmap rendering of the child.

§child: Option<WidgetRef>

The widget below this widget in the tree.

Implementations§

Source§

impl MatrixTransition

Source

pub fn new( animation: AnimationRef<f64>, on_transform: impl Fn(f64) -> Matrix4 + 'static, ) -> MatrixTransition

Creates a matrix transition.

The alignment defaults to Alignment::CENTER.

Source

pub fn key(self, key: KeyRef) -> MatrixTransition

Dart MatrixTransition(key:).

Source

pub fn alignment(self, alignment: Alignment) -> MatrixTransition

Dart MatrixTransition(alignment:).

Source

pub fn filter_quality(self, filter_quality: FilterQuality) -> MatrixTransition

Dart MatrixTransition(filterQuality:).

Source

pub fn child<K>(self, child: impl IntoWidget<K>) -> MatrixTransition

Dart MatrixTransition(child:).

Trait Implementations§

Source§

impl AnimatedWidget for MatrixTransition

Source§

fn key(&self) -> Option<&KeyRef>

Source§

fn listenable(&self) -> Rc<dyn Listenable>

The Listenable to which this widget is listening. Read more
Source§

fn build(&self, app: &mut App, _context: BuildContext) -> WidgetRef

Override this method to build widgets that depend on the state of the listenable (e.g., the current value of the animation).
Source§

fn debug_fill_properties(&self, properties: &mut DiagnosticPropertiesBuilder)

Dart’s AnimatedWidget.debugFillProperties, which a subclass’s own body calls where Dart writes super.
Source§

impl Debug for MatrixTransition

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for MatrixTransition

§

impl !Send for MatrixTransition

§

impl !Sync for MatrixTransition

§

impl !UnwindSafe for MatrixTransition

§

impl Forget for MatrixTransition

§

impl Freeze for MatrixTransition
where *const RcInner<dyn Key> is !null: Freeze, PhantomData<RcInner<dyn Key>>: Freeze, *const RcInner<dyn Fn(f64) -> Matrix> is !null: Freeze, PhantomData<RcInner<dyn Fn(f64) -> Matrix>>: Freeze, NonZero<u32>: Freeze, &'static AnimationVTable<f64>: Freeze, *const RcInner<Keep> is !null: Freeze, PhantomData<RcInner<Keep>>: Freeze, *const RcInner<dyn Widget> is !null: Freeze, PhantomData<RcInner<dyn Widget>>: Freeze,

§

impl Move for MatrixTransition

§

impl Unpin for MatrixTransition
where Rc<dyn Key>: Unpin, Rc<dyn Fn(f64) -> Matrix>: Unpin, NonZero<u32>: Unpin, &'static AnimationVTable<f64>: Unpin, Rc<Keep>: Unpin, Rc<dyn Widget>: Unpin,

§

impl UnsafeUnpin for MatrixTransition
where *const RcInner<dyn Key> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Key>>: UnsafeUnpin, *const RcInner<dyn Fn(f64) -> Matrix> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Fn(f64) -> Matrix>>: UnsafeUnpin, NonZeroU32Inner: UnsafeUnpin, &'static AnimationVTable<f64>: UnsafeUnpin, *const RcInner<Keep> is !null: UnsafeUnpin, PhantomData<RcInner<Keep>>: UnsafeUnpin, *const RcInner<dyn Widget> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Widget>>: 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<W> IntoWidget<AnimatedKind> for W
where W: AnimatedWidget,

Source§

fn into_widget(self) -> Rc<dyn Widget>

The widget as a tree node, made where this is called: its creation_location.
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>