existsOnce method

WidgetMatcher<W> existsOnce()

Asserts that exactly one widget of type W exists.

Example usage:

spot<ElevatedButton>().existsOnce();

See also:

Implementation

WidgetMatcher<W> existsOnce() {
  final one =
      copyWith(quantityConstraint: const QuantityConstraint.exactly(1));
  return snapshot(one).single;
}