existsAtLeastOnce method

MultiWidgetMatcher<W> existsAtLeastOnce()

Asserts that at least one widget of type W exists.

This matcher is used when the expectation is to have one or more widgets of type W present in the widget tree.

Example usage:

spot<ElevatedButton>().existsAtLeastOnce();

See also:

Implementation

MultiWidgetMatcher<W> existsAtLeastOnce() {
  final atLeastOne =
      copyWith(quantityConstraint: const QuantityConstraint.atLeast(1));
  return snapshot(atLeastOne).multi;
}