find method
Find a node that matches the given text.
Implementation
Future<SemanticsNode?> find(String text, {Duration? timeout}) async {
var nodes = _findNodes(_semanticsOwner.rootSemanticsNode!, text);
final end = clock.now().add(timeout ?? const Duration(seconds: 10));
while (nodes.isEmpty) {
await pump();
if (clock.now().isAfter(end)) {
return null;
}
nodes = _findNodes(_semanticsOwner.rootSemanticsNode!, text);
}
return nodes.first;
}