queryAllByText

List<DomNode> queryAllByText(

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

Finds all elements containing the given text.

Implementation

List<DomNode> queryAllByText(String text, {bool exact = true}) {
  final all = _getAllElements(_container);
  return all.where((el) {
    final content = el.textContent;
    return exact ? content == text : content.contains(text);
  }).toList();
}