pub struct SlideTransition {
pub key: Option<KeyRef>,
pub position: AnimationRef<Offset>,
pub text_direction: Option<TextDirection>,
pub transform_hit_tests: bool,
pub child: Option<WidgetRef>,
}Expand description
Animates the position of a widget relative to its normal position.
The translation is expressed as an Offset scaled to the child’s size. For
example, an Offset with a dx of 0.25 will result in a horizontal
translation of one quarter the width of the child.
By default, the offsets are applied in the coordinate system of the canvas
(so positive x offsets move the child towards the right). If a
text_direction is provided, then the offsets are applied in the
reading direction, so in right-to-left text, positive x offsets move towards the
left, and in left-to-right text, positive x offsets move towards the right.
See also:
AlignTransition, an animated version of anAlignthat animates itsAlign::alignmentproperty.PositionedTransition, a widget that animates its child from a start position to an end position over the lifetime of the animation.RelativePositionedTransition, a widget that transitions its child’s position based on the value of a rectangle relative to a bounding box.
Fields§
§key: Option<KeyRef>See Widget::key.
position: AnimationRef<Offset>The animation that controls the position of the child.
If the current value of the position animation is (dx, dy), the child
will be translated horizontally by width * dx and vertically by
height * dy, after applying the text_direction if available.
text_direction: Option<TextDirection>The direction to use for the x offset described by the position.
If text_direction is None, the x offset is applied in the
coordinate system of the canvas (so positive x offsets move the child towards the
right).
If text_direction is TextDirection::Rtl, the x offset is
applied in the reading direction such that x offsets move the child towards the left.
If text_direction is TextDirection::Ltr, the x offset is
applied in the reading direction such that x offsets move the child towards the right.
transform_hit_tests: boolWhether hit testing should be affected by the slide animation.
If false, hit testing will proceed as if the child was not translated at all. Setting this value to false is useful for fast animations where you expect the user to commonly interact with the child widget in its final location and you want the user to benefit from “muscle memory”.
child: Option<WidgetRef>The widget below this widget in the tree.
Implementations§
Source§impl SlideTransition
impl SlideTransition
Sourcepub fn new(position: AnimationRef<Offset>) -> SlideTransition
pub fn new(position: AnimationRef<Offset>) -> SlideTransition
Creates a fractional translation transition.
Sourcepub fn key(self, key: KeyRef) -> SlideTransition
pub fn key(self, key: KeyRef) -> SlideTransition
Dart SlideTransition(key:).
Sourcepub fn text_direction(self, text_direction: TextDirection) -> SlideTransition
pub fn text_direction(self, text_direction: TextDirection) -> SlideTransition
Dart SlideTransition(textDirection:).
Sourcepub fn transform_hit_tests(self, transform_hit_tests: bool) -> SlideTransition
pub fn transform_hit_tests(self, transform_hit_tests: bool) -> SlideTransition
Dart SlideTransition(transformHitTests:).
Sourcepub fn child<K>(self, child: impl IntoWidget<K>) -> SlideTransition
pub fn child<K>(self, child: impl IntoWidget<K>) -> SlideTransition
Dart SlideTransition(child:).
Trait Implementations§
Source§impl AnimatedWidget for SlideTransition
impl AnimatedWidget for SlideTransition
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 SlideTransition
impl !Send for SlideTransition
impl !Sync for SlideTransition
impl !UnwindSafe for SlideTransition
impl Forget for SlideTransition
impl Freeze for SlideTransitionwhere
*const RcInner<dyn Key> is !null: Freeze,
PhantomData<RcInner<dyn Key>>: Freeze,
NonZero<u32>: Freeze,
&'static AnimationVTable<Offset>: 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 SlideTransition
impl Unpin for SlideTransition
impl UnsafeUnpin for SlideTransitionwhere
*const RcInner<dyn Key> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Key>>: UnsafeUnpin,
NonZeroU32Inner: UnsafeUnpin,
&'static AnimationVTable<Offset>: 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.