whereElement method
Creates a filter for the discovered elements which is applied when the WidgetSelector is snapshotted.
The description
is required to make error messages understandable.
Example usage:
spot<Checkbox>()
.whereElement(
(el) => (el.widget as Checkbox).value == true,
description: 'is checked',
).existsOnce();
Implementation
@useResult
WidgetSelector<W> whereElement(
bool Function(Element element) predicate, {
required String description,
}) {
return self.addStage(
PredicateFilter(
predicate: predicate,
description: description,
),
);
}