scrollable method

SemanticsFinder scrollable({
  1. Axis? axis,
  2. FlutterView? view,
})

Finds any SemanticsNodes that can scroll in at least one direction.

If axis is provided, then the search will be limited to scrollable nodes that can scroll in the given axis. If axis is not provided, then both horizontal and vertical scrollable nodes will be found.

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 scrollable({Axis? axis, FlutterView? view}) {
  return byAnyAction(<SemanticsAction>[
    if (axis == null || axis == Axis.vertical) ...<SemanticsAction>[
      SemanticsAction.scrollUp,
      SemanticsAction.scrollDown,
    ],
    if (axis == null || axis == Axis.horizontal) ...<SemanticsAction>[
      SemanticsAction.scrollLeft,
      SemanticsAction.scrollRight,
    ],
  ]);
}