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>See Widget::key.
on_transform: TransformCallbackThe 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: AlignmentThe 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
impl MatrixTransition
Sourcepub fn new(
animation: AnimationRef<f64>,
on_transform: impl Fn(f64) -> Matrix4 + 'static,
) -> MatrixTransition
pub fn new( animation: AnimationRef<f64>, on_transform: impl Fn(f64) -> Matrix4 + 'static, ) -> MatrixTransition
Creates a matrix transition.
The alignment defaults to Alignment::CENTER.
Sourcepub fn key(self, key: KeyRef) -> MatrixTransition
pub fn key(self, key: KeyRef) -> MatrixTransition
Dart MatrixTransition(key:).
Sourcepub fn alignment(self, alignment: Alignment) -> MatrixTransition
pub fn alignment(self, alignment: Alignment) -> MatrixTransition
Dart MatrixTransition(alignment:).
Sourcepub fn filter_quality(self, filter_quality: FilterQuality) -> MatrixTransition
pub fn filter_quality(self, filter_quality: FilterQuality) -> MatrixTransition
Dart MatrixTransition(filterQuality:).
Sourcepub fn child<K>(self, child: impl IntoWidget<K>) -> MatrixTransition
pub fn child<K>(self, child: impl IntoWidget<K>) -> MatrixTransition
Dart MatrixTransition(child:).
Trait Implementations§
Source§impl AnimatedWidget for MatrixTransition
impl AnimatedWidget for MatrixTransition
Source§fn listenable(&self) -> Rc<dyn Listenable>
fn listenable(&self) -> Rc<dyn Listenable>
Listenable to which this widget is listening. Read moreSource§fn build(&self, app: &mut App, _context: BuildContext) -> WidgetRef
fn build(&self, app: &mut App, _context: BuildContext) -> WidgetRef
Source§fn debug_fill_properties(&self, properties: &mut DiagnosticPropertiesBuilder)
fn debug_fill_properties(&self, properties: &mut DiagnosticPropertiesBuilder)
AnimatedWidget.debugFillProperties, which a subclass’s own body calls where
Dart writes super.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 MatrixTransitionwhere
*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
impl UnsafeUnpin for MatrixTransitionwhere
*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> 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<W> IntoWidget<AnimatedKind> for Wwhere
W: AnimatedWidget,
impl<W> IntoWidget<AnimatedKind> for Wwhere
W: AnimatedWidget,
Source§fn into_widget(self) -> Rc<dyn Widget>
fn into_widget(self) -> Rc<dyn Widget>
creation_location.