Skip to main content

DefaultTextStyleTransition

Struct DefaultTextStyleTransition 

Source
pub struct DefaultTextStyleTransition {
    pub key: Option<KeyRef>,
    pub style: AnimationRef<TextStyle>,
    pub text_align: Option<TextAlign>,
    pub soft_wrap: bool,
    pub overflow: TextOverflow,
    pub max_lines: Option<i32>,
    pub child: WidgetRef,
}
Expand description

Animated version of a DefaultTextStyle that animates the different properties of its TextStyle.

See also:

  • AnimatedDefaultTextStyle, which animates changes in text style without taking an explicit Animation argument.
  • DefaultTextStyle, which also defines a TextStyle for its descendants but is not animated.

Fields§

§key: Option<KeyRef>§style: AnimationRef<TextStyle>

The animation that controls the descendants’ text style.

§text_align: Option<TextAlign>

How the text should be aligned horizontally.

§soft_wrap: bool

Whether the text should break at soft line breaks.

See DefaultTextStyle::soft_wrap for more details.

§overflow: TextOverflow

How visual overflow should be handled.

§max_lines: Option<i32>

An optional maximum number of lines for the text to span, wrapping if necessary.

See DefaultTextStyle::max_lines for more details.

§child: WidgetRef

The widget below this widget in the tree.

Implementations§

Source§

impl DefaultTextStyleTransition

Source

pub fn new<K>( style: AnimationRef<TextStyle>, child: impl IntoWidget<K>, ) -> DefaultTextStyleTransition

Creates an animated DefaultTextStyle whose TextStyle animation updates the widget.

Source

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

Dart DefaultTextStyleTransition(key:).

Source

pub fn text_align(self, text_align: TextAlign) -> DefaultTextStyleTransition

Dart DefaultTextStyleTransition(textAlign:).

Source

pub fn soft_wrap(self, soft_wrap: bool) -> DefaultTextStyleTransition

Dart DefaultTextStyleTransition(softWrap:).

Source

pub fn overflow(self, overflow: TextOverflow) -> DefaultTextStyleTransition

Dart DefaultTextStyleTransition(overflow:).

Source

pub fn max_lines(self, max_lines: i32) -> DefaultTextStyleTransition

Dart DefaultTextStyleTransition(maxLines:).

Trait Implementations§

Source§

impl AnimatedWidget for DefaultTextStyleTransition

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 DefaultTextStyleTransition

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for DefaultTextStyleTransition

§

impl !Send for DefaultTextStyleTransition

§

impl !Sync for DefaultTextStyleTransition

§

impl !UnwindSafe for DefaultTextStyleTransition

§

impl Forget for DefaultTextStyleTransition

§

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

§

impl Unpin for DefaultTextStyleTransition
where Rc<dyn Key>: Unpin, NonZero<u32>: Unpin, &'static AnimationVTable<TextStyle>: Unpin, Rc<Keep>: Unpin, Rc<dyn Widget>: Unpin,

§

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