userType
Future<
Simulate typing into a TextInput.
Implementation
Future<void> userType(TestNode input, String text) async {
if (input.type != 'TextInput') {
throw TestingException('userType requires a TextInput node');
}
// Type character by character
final buffer = StringBuffer(input.value ?? '');
for (final char in text.split('')) {
buffer.write(char);
input.fireChangeText(buffer.toString());
await Future<void>.delayed(const Duration(milliseconds: 10));
}
}