TypeWriterText constructor

const TypeWriterText({
  1. Key? key,
  2. Alignment? alignment,
  3. bool maintainSize = true,
  4. bool repeat = false,
  5. bool play = true,
  6. void onFinished(
    1. String value
    )?,
  7. required Text? text,
  8. required Duration duration,
})

Create a wrapper widget to animate Text with typewriter animation.

const TypeWriterText(
  text: Text("your text"),
  duration: Duration(milliseconds:50),
);

Implementation

const TypeWriterText({
  super.key,
  this.alignment,
  this.maintainSize = true,
  this.repeat = false,
  this.play = true,
  this.onFinished,
  required this.text,
  required this.duration,
})  : _type = _TypeWriterTextType._text,
      builder = null,
      data = '',
      assert(onFinished == null || !repeat && play,
          'Cannot have onFinished when ${repeat ? '[repeat] is `true`.' : '[play] is `false`.'}');