AnimatedText constructor

const AnimatedText(
  1. String text, {
  2. Key? key,
  3. List<TextEffect> effects = const [],
  4. TextEffectController? controller,
  5. TextStyle? style,
  6. TextAlign textAlign = TextAlign.start,
  7. bool autoplay = true,
  8. bool repeat = false,
  9. bool reverse = false,
  10. TextDirection textDirection = TextDirection.ltr,
  11. StrutStyle? strutStyle,
  12. TextHeightBehavior? textHeightBehavior,
  13. TextWidthBasis textWidthBasis = TextWidthBasis.parent,
  14. bool keepAlive = true,
})

Creates an AnimatedText widget that animates the given text.

text — the string to animate (required, positional). effects — list of TextEffects composed onto the text. controller — optional external TextEffectController. style — text style (falls back to DefaultTextStyle). textAlign — horizontal text alignment. autoplay — whether playback starts on mount. repeat — whether the animation loops indefinitely. reverse — whether looping plays forward then backward. textDirection — layout direction (affects alignment). strutStyle — optional strut for consistent line height. textHeightBehavior — optional height behavior override. textWidthBasis — how text width is computed. keepAlive — preserves animation in scroll-off (lazy list).

Implementation

const AnimatedText(
  this.text, {
  super.key,
  this.effects = const [],
  this.controller,
  this.style,
  this.textAlign = TextAlign.start,
  this.autoplay = true,
  this.repeat = false,
  this.reverse = false,
  this.textDirection = TextDirection.ltr,
  this.strutStyle,
  this.textHeightBehavior,
  this.textWidthBasis = TextWidthBasis.parent,
  this.keepAlive = true,
});