existsExactlyNTimes method

MultiWidgetMatcher<W> existsExactlyNTimes(
  1. int n
)

Asserts that exactly n widgets of type W exist.

Example usage:

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

See also:

Implementation

MultiWidgetMatcher<W> existsExactlyNTimes(int n) {
  final exactlyNTimes =
      copyWith(quantityConstraint: QuantityConstraint.exactly(n));
  return snapshot(exactlyNTimes).multi;
}