AnimatedText class

Displays animated text with one or more composable TextEffects.

Each character is individually rendered and animated by combining the output of all registered effects via CharacterAnimation.combine.

Supports external playback control via TextEffectController and preserves animation state when scrolled off-screen via keepAlive.

AnimatedText(
  'Hello World',
  effects: [FadeEffect(), WaveEffect()],
  style: TextStyle(fontSize: 32),
)
Inheritance

Constructors

AnimatedText(String text, {Key? key, List<TextEffect> effects = const [], TextEffectController? controller, TextStyle? style, TextAlign textAlign = TextAlign.start, bool autoplay = true, bool repeat = false, bool reverse = false, TextDirection textDirection = TextDirection.ltr, StrutStyle? strutStyle, TextHeightBehavior? textHeightBehavior, TextWidthBasis textWidthBasis = TextWidthBasis.parent, bool keepAlive = true})
Creates an AnimatedText widget that animates the given text.
const

Properties

autoplay bool
Whether playback begins automatically on mount.
final
controller TextEffectController?
Optional external controller for shared playback orchestration.
final
effects List<TextEffect>
List of animation effects applied and composed together.
final
hashCode int
The hash code for this object.
no setterinherited
keepAlive bool
When true (default), animation state survives scroll-off in a lazy list.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
repeat bool
Whether the animation loops indefinitely.
final
reverse bool
Whether repeated animations play forwards then backwards.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
strutStyle StrutStyle?
Optional strut style for consistent line height.
final
style TextStyle?
Text style applied to every character. Defaults to DefaultTextStyle.
final
text String
The text string to animate character by character.
final
textAlign TextAlign
Alignment of the text within its bounds.
final
textDirection TextDirection
Text direction for layout (affects alignment and box selection).
final
textHeightBehavior TextHeightBehavior?
Optional text height behavior override.
final
textWidthBasis TextWidthBasis
How text width is computed relative to the parent.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<AnimatedText>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited