swipeBack method

Future<void> swipeBack({
  1. double dy = 0.5,
  2. String? appId,
})

Mimics the swipe back (left to right) gesture.

dy determines the vertical offset of the swipe. It must be in the inclusive 0-1 range.

appId optionally specifies the application ID to target.

This is equivalent to: $.native.swipe( from: Offset(0, dy), to: Offset(1, dy), appId: appId, );

On Android, navigation with gestures might have to be turned on in devices settings.

Example usage:

await tester.swipeBack(dy: 0.8); // Swipe back at 1/5 height of the screen
await tester.swipeBack(); // Swipe back at the center of the screen

Implementation

Future<void> swipeBack({double dy = 0.5, String? appId}) =>
    _platform.mobile.swipeBack(dy: dy, appId: appId);