findsOneComponent top-level constant

Matcher const findsOneComponent

Asserts that the Finder locates at exactly one component in the component tree.

Sample code

expect(find.text('Save'), findsOneComponent);

See also:

  • findsNothing, when you want the finder to not find anything.
  • findsComponents, when you want the finder to find one or more components.
  • findsNComponents, when you want the finder to find a specific number of components.

Implementation

const Matcher findsOneComponent = _FindsComponentMatcher(1, 1);