findElement<T> function

Element? findElement<T>(
  1. BuildContext context,
  2. bool compare(
    1. T
    )
)

Finds the first Element in the provided context that matches the provided compare function.

Implementation

Element? findElement<T>(BuildContext context, bool Function(T) compare) {
  Element? element;

  context.visitChildElements((Element e) => element = e);

  return _findByElement(element!, compare);
}