swipe method

Future<void> swipe({
  1. required Offset from,
  2. required Offset to,
  3. int steps = 12,
  4. String? appId,
  5. bool enablePatrolLog = true,
})

Swipes from from to to.

from and to must be in the inclusive 0-1 range.

On Android, steps controls speed and smoothness. One unit of steps is equivalent to 5 ms. If you want to slow down the swipe time, increase steps. If swipe doesn't work, try increasing steps.

Implementation

Future<void> swipe({
  required Offset from,
  required Offset to,
  int steps = 12,
  String? appId,
  bool enablePatrolLog = true,
}) {
  return platform.action.mobile(
    android: () => platform.android.swipe(
      from: from,
      to: to,
      steps: steps,
      enablePatrolLog: enablePatrolLog,
    ),
    ios: () => platform.ios.swipe(
      from: from,
      to: to,
      appId: appId,
      enablePatrolLog: enablePatrolLog,
    ),
  );
}