expectTextVisible function

void expectTextVisible(
  1. String text
)

Assert that the given text is visible in the widget tree.

Example:

expectTextVisible('Welcome');
expectTextVisible('Hello, John');

Implementation

void expectTextVisible(String text) {
  expect(
    find.text(text),
    findsOneWidget,
    reason: 'Expected text "$text" to be visible',
  );
}