Skip to main content

RelativePositionedTransition

Struct RelativePositionedTransition 

Source
pub struct RelativePositionedTransition {
    pub key: Option<KeyRef>,
    pub rect: AnimationRef<Option<Rect>>,
    pub size: Size,
    pub child: WidgetRef,
}
Expand description

Animated version of Positioned which transitions the child’s position based on the value of rect relative to a bounding box with the specified size.

Only works if it’s the child of a Stack.

See also:

  • PositionedTransition, a widget that animates its child from a start position to an end position over the lifetime of the animation.
  • AlignTransition, an animated version of an Align that animates its Align::alignment property.
  • ScaleTransition, a widget that animates the scale of a transformed widget.
  • SizeTransition, a widget that animates its own size and clips and aligns its child.
  • SlideTransition, a widget that animates the position of a widget relative to its normal position.

Fields§

§key: Option<KeyRef>§rect: AnimationRef<Option<Rect>>

The animation that controls the child’s size and position.

If the animation returns a None Rect, the rect is assumed to be Rect::ZERO.

See also:

  • size, which gets the size of the box that the Positioned widget’s offsets are relative to.
§size: Size

The Positioned widget’s offsets are relative to a box of this size whose origin is 0,0.

§child: WidgetRef

The widget below this widget in the tree.

Implementations§

Source§

impl RelativePositionedTransition

Source

pub fn new<K>( rect: AnimationRef<Option<Rect>>, size: Size, child: impl IntoWidget<K>, ) -> RelativePositionedTransition

Create an animated version of Positioned.

Each frame, the Positioned widget will be configured to represent the current value of the rect argument assuming that the stack has the given size.

Source

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

Dart RelativePositionedTransition(key:).

Trait Implementations§

Source§

impl AnimatedWidget for RelativePositionedTransition

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 RelativePositionedTransition

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for RelativePositionedTransition

§

impl !Send for RelativePositionedTransition

§

impl !Sync for RelativePositionedTransition

§

impl !UnwindSafe for RelativePositionedTransition

§

impl Forget for RelativePositionedTransition

§

impl Freeze for RelativePositionedTransition
where *const RcInner<dyn Key> is !null: Freeze, PhantomData<RcInner<dyn Key>>: Freeze, NonZero<u32>: Freeze, &'static AnimationVTable<Option<Rect>>: 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 RelativePositionedTransition

§

impl Unpin for RelativePositionedTransition
where Rc<dyn Key>: Unpin, NonZero<u32>: Unpin, &'static AnimationVTable<Option<Rect>>: Unpin, Rc<Keep>: Unpin, Rc<dyn Widget>: Unpin,

§

impl UnsafeUnpin for RelativePositionedTransition
where *const RcInner<dyn Key> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Key>>: UnsafeUnpin, NonZeroU32Inner: UnsafeUnpin, &'static AnimationVTable<Option<Rect>>: 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>