withText method

  1. @useResult
WidgetSelector<AnyText> withText(
  1. String? value
)

Creates a WidgetSelector that finds all AnyText where text equals (==) value.

Example usage:

spot<AnyText>().withText('foo').existsOnce();

Implementation

@useResult
WidgetSelector<AnyText> withText(String? value) {
  return withDiagnosticProp<String>(
      'text', (it) => value == null ? it.isNull() : it.equals(value));
}