tapEachInTurn function

Future<void> tapEachInTurn(
  1. InteractionBackend backend,
  2. List<({int x, int y})> points,
  3. int intervalMs
)

InteractionBackend.tapSequence as one tap call per point, for backends with no batched form.

Implementation

Future<void> tapEachInTurn(InteractionBackend backend, List<({int x, int y})> points, int intervalMs) async {
  for (var i = 0; i < points.length; i++) {
    await backend.tap(physicalX: points[i].x, physicalY: points[i].y);
    if (i < points.length - 1 && intervalMs > 0) {
      await Future<void>.delayed(Duration(milliseconds: intervalMs));
    }
  }
}