spotTextWhere function

  1. @useResult
WidgetSelector<AnyText> spotTextWhere(
  1. void match(
    1. Subject<String>
    ), {
  2. List<WidgetSelector<Widget>> parents = const [],
  3. List<WidgetSelector<Widget>> children = const [],
})

Finds text matching match on the screen

This methods gives more control how the text is matched compared to spotText.

Text('Hello World');

// all match the Text widget above
spotTextWhere((it) => it.equals('Hello World'));
spotTextWhere((it) => it.startsWith('Hello'));
spotTextWhere((it) => it.endsWith('World!'));
spotTextWhere((it) => it.contains('Wo'));
spotText('Wo');

Implementation

@useResult
WidgetSelector<AnyText> spotTextWhere(
  void Function(Subject<String>) match, {
  List<WidgetSelector> parents = const [],
  List<WidgetSelector> children = const [],
}) {
  return _global.spotTextWhere(
    match,
    parents: parents,
    children: children,
  );
}