animatedBuilder method

  1. @override
Widget animatedBuilder(
  1. BuildContext context,
  2. Widget? child
)
override

Widget showing partial text, up to count characters

Implementation

@override
Widget animatedBuilder(BuildContext context, Widget? child) {
  /// Output of CurveTween is in the range [0, 1] for majority of the curves.
  /// It is converted to [0, textCharacters.length].
  final count =
      (_typingText.value.clamp(0, 1) * textCharacters.length).round();

  assert(count <= textCharacters.length);
  return textWidget(textCharacters.take(count).toString());
}