queryAllByAltText

List<DomNode> queryAllByAltText(

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

Finds all images with the given alt text.

Implementation

List<DomNode> queryAllByAltText(String altText, {bool exact = true}) =>
    _container.querySelectorAll('img[alt]').where((el) {
      final alt = el.getAttribute('alt') ?? '';
      return exact ? alt == altText : alt.contains(altText);
    }).toList();