queryByText

TestNode? queryByText(

  1. String text, {
  2. bool exact = false,
})

Query by text (returns null if not found) instead of throwing.

Implementation

TestNode? queryByText(String text, {bool exact = false}) {
  final results = findByText(text, exact: exact);
  return results.isEmpty ? null : results.first;
}