existsAtMostNTimes method
Asserts that at most n
widgets of type W
exist.
Example usage:
spot<ElevatedButton>().existsAtMostNTimes(2);
See also:
- doesNotExist asserts that no widgets of type
W
exist. - existsOnce asserts that exactly one widget of type
W
exists. - existsExactlyNTimes asserts that exactly
n
widgets of typeW
exist. - existsAtLeastOnce asserts that at least one widget of type
W
exists. - existsAtLeastNTimes asserts that at least
n
widgets of typeW
exist. - existsAtMostOnce asserts that at most one widget exists.
Implementation
MultiWidgetMatcher<W> existsAtMostNTimes(int n) {
final atMostN = copyWith(quantityConstraint: QuantityConstraint.atMost(n));
return snapshot(atMostN).multi;
}