write method

Future<void> write({
  1. required String newText,
  2. Duration delayDuration = const Duration(milliseconds: 100),
})

Implementation

Future<void> write({
  required String newText,
  Duration delayDuration = const Duration(milliseconds: 100),
}) async {
  final List<String> characters = newText.characters.toList();
  for (var i = 0; i < characters.length; i++) {
    String character = characters[i];
    await Future.delayed(delayDuration);
    text += character;
  }
  return;
}