byAction method

SemanticsFinder byAction(
  1. SemanticsAction action, {
  2. FlutterView? view,
})

Finds any SemanticsNodes that has the given SemanticsAction.

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 byAction(SemanticsAction action, {FlutterView? view}) {
  return byPredicate(
    (SemanticsNode node) => node.getSemanticsData().hasAction(action),
    describeMatch: (Plurality plurality) => '${switch (plurality) {
      Plurality.one => 'SemanticsNode',
      Plurality.zero || Plurality.many => 'SemanticsNodes',
    }} with action "$action"',
    view: view,
  );
}