byHint method

SemanticsFinder byHint(
  1. Pattern hint, {
  2. FlutterView? view,
})

Finds any SemanticsNodes that has a SemanticsNode.hint that matches the given hint.

The view provided will be used to determine the semantics tree where the search will be evaluated. If not provided, the search will be evaluated against the semantics tree of WidgetTester.view.

Implementation

SemanticsFinder byHint(Pattern hint, {FlutterView? view}) {
  return byPredicate(
    (SemanticsNode node) => _matchesPattern(node.hint, hint),
    describeMatch: (Plurality plurality) => '${switch (plurality) {
      Plurality.one => 'SemanticsNode',
      Plurality.zero || Plurality.many => 'SemanticsNodes',
    }} with hint "$hint"',
    view: view,
  );
}