pub struct AnimatedAlign {
pub alignment: AlignmentGeometry,
pub child: Option<WidgetRef>,
pub height_factor: Option<f64>,
pub width_factor: Option<f64>,
/* private fields */
}Expand description
Animated version of Align which automatically transitions the child’s
position over a given duration whenever the given
alignment changes.
For the animation, you can choose a curve as
well as a duration and the widget will
automatically animate to the new target alignment. If you require
more control over the animation (e.g. if you want to stop it mid-animation), consider
using an AlignTransition instead, which takes a provided Animation as argument. While
that allows you to fine-tune the animation, it also requires more development overhead as
you have to manually manage the lifecycle of the underlying AnimationController.
See also:
AnimatedContainer, which can transition more values at once.AnimatedPadding, which can animate the padding instead of the alignment.AnimatedSlide, which can animate the translation of child by a given offset relative to its size.AnimatedPositioned, which, as a child of aStack, automatically transitions its child’s position over a given duration whenever the given position changes.
Fields§
§alignment: AlignmentGeometryHow to align the child.
The x and y values of the Alignment control the horizontal and vertical
alignment, respectively. An x value of -1.0 means that the left edge of
the child is aligned with the left edge of the parent whereas an x value
of 1.0 means that the right edge of the child is aligned with the right
edge of the parent. Other values interpolate (and extrapolate) linearly.
For example, a value of 0.0 means that the center of the child is aligned
with the center of the parent.
child: Option<WidgetRef>The widget below this widget in the tree.
height_factor: Option<f64>If non-None, sets its height to the child’s height multiplied by this factor.
Must be greater than or equal to 0.0, defaults to None.
width_factor: Option<f64>If non-None, sets its width to the child’s width multiplied by this factor.
Must be greater than or equal to 0.0, defaults to None.
Implementations§
Source§impl AnimatedAlign
impl AnimatedAlign
Sourcepub fn new(alignment: AlignmentGeometry, duration: Duration) -> AnimatedAlign
pub fn new(alignment: AlignmentGeometry, duration: Duration) -> AnimatedAlign
Creates a widget that positions its child by an alignment that animates implicitly.
Sourcepub fn child<K>(self, child: impl IntoWidget<K>) -> AnimatedAlign
pub fn child<K>(self, child: impl IntoWidget<K>) -> AnimatedAlign
Dart AnimatedAlign(child:).
Sourcepub fn height_factor(self, height_factor: f64) -> AnimatedAlign
pub fn height_factor(self, height_factor: f64) -> AnimatedAlign
Dart AnimatedAlign(heightFactor:).
Sourcepub fn width_factor(self, width_factor: f64) -> AnimatedAlign
pub fn width_factor(self, width_factor: f64) -> AnimatedAlign
Dart AnimatedAlign(widthFactor:).
Sourcepub fn key(self, key: KeyRef) -> AnimatedAlign
pub fn key(self, key: KeyRef) -> AnimatedAlign
Dart key:.
Sourcepub fn curve(self, curve: Rc<dyn Curve>) -> AnimatedAlign
pub fn curve(self, curve: Rc<dyn Curve>) -> AnimatedAlign
Dart curve:.
Sourcepub fn on_end(self, on_end: Listener) -> AnimatedAlign
pub fn on_end(self, on_end: Listener) -> AnimatedAlign
Dart onEnd:.
Trait Implementations§
Source§impl Debug for AnimatedAlign
impl Debug for AnimatedAlign
Source§impl ImplicitlyAnimatedWidget for AnimatedAlign
impl ImplicitlyAnimatedWidget for AnimatedAlign
Source§fn implicitly_animated_widget_data_mut(
&mut self,
) -> &mut ImplicitlyAnimatedWidgetData
fn implicitly_animated_widget_data_mut( &mut self, ) -> &mut ImplicitlyAnimatedWidgetData
ImplicitlyAnimatedWidgetData bag, mutably.Source§impl StatefulWidget for AnimatedAlign
impl StatefulWidget for AnimatedAlign
Source§type State = AnimatedAlignState
type State = AnimatedAlignState
Source§fn debug_fill_properties(
&self,
_app: &App,
properties: &mut DiagnosticPropertiesBuilder,
)
fn debug_fill_properties( &self, _app: &App, properties: &mut DiagnosticPropertiesBuilder, )
debugFillProperties: the properties a dump shows for this widget, in Dart’s
order. Dart’s Widget base only sets the dense tree style, which the framework does.Source§fn create_state(&self) -> AnimatedAlignState
fn create_state(&self) -> AnimatedAlignState
Source§fn as_preferred_size_widget(&self) -> Option<&dyn PreferredSizeWidget>
fn as_preferred_size_widget(&self) -> Option<&dyn PreferredSizeWidget>
Source§fn type_name(&self) -> &'static str
fn type_name(&self) -> &'static str
Widget::type_name. A stateful form another widget kind becomes (an animated or
status transition widget) names the widget it wraps.Auto Trait Implementations§
impl !RefUnwindSafe for AnimatedAlign
impl !Send for AnimatedAlign
impl !Sync for AnimatedAlign
impl !UnwindSafe for AnimatedAlign
impl Forget for AnimatedAlign
impl Freeze for AnimatedAlignwhere
*const RcInner<dyn Key> is !null: Freeze,
PhantomData<RcInner<dyn Key>>: Freeze,
*const RcInner<dyn Curve> is !null: Freeze,
PhantomData<RcInner<dyn Curve>>: Freeze,
*const RcInner<dyn Fn(&mut App)> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&mut App)>>: Freeze,
NonZero<u32>: Freeze,
*const (): Freeze,
*const RcInner<dyn Widget> is !null: Freeze,
PhantomData<RcInner<dyn Widget>>: Freeze,
impl Move for AnimatedAlign
impl Unpin for AnimatedAlign
impl UnsafeUnpin for AnimatedAlignwhere
*const RcInner<dyn Key> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Key>>: UnsafeUnpin,
*const RcInner<dyn Curve> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Curve>>: UnsafeUnpin,
*const RcInner<dyn Fn(&mut App)> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&mut App)>>: UnsafeUnpin,
NonZeroU32Inner: UnsafeUnpin,
*const (): 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<StatefulKind> for Wwhere
W: StatefulWidget,
impl<W> IntoWidget<StatefulKind> for Wwhere
W: StatefulWidget,
Source§fn into_widget(self) -> Rc<dyn Widget>
fn into_widget(self) -> Rc<dyn Widget>
creation_location.