existsAtMostNTimes method

MultiWidgetMatcher<W> existsAtMostNTimes(
  1. int n
)

Asserts that at most n widgets of type W exist.

Example usage:

spot<ElevatedButton>().existsAtMostNTimes(2);

See also:

Implementation

MultiWidgetMatcher<W> existsAtMostNTimes(int n) {
  final atMostN = copyWith(quantityConstraint: QuantityConstraint.atMost(n));
  return snapshot(atMostN).multi;
}