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