synthesizeScrollGesture method

Future<void> synthesizeScrollGesture(
  1. num x,
  2. num y, {
  3. num? xDistance,
  4. num? yDistance,
  5. num? xOverscroll,
  6. num? yOverscroll,
  7. bool? preventFling,
  8. int? speed,
  9. GestureSourceType? gestureSourceType,
  10. int? repeatCount,
  11. int? repeatDelayMs,
  12. String? interactionMarkerName,
})

Synthesizes a scroll gesture over a time period by issuing appropriate touch events. x X coordinate of the start of the gesture in CSS pixels. y Y coordinate of the start of the gesture in CSS pixels. xDistance The distance to scroll along the X axis (positive to scroll left). yDistance The distance to scroll along the Y axis (positive to scroll up). xOverscroll The number of additional pixels to scroll back along the X axis, in addition to the given distance. yOverscroll The number of additional pixels to scroll back along the Y axis, in addition to the given distance. preventFling Prevent fling (default: true). speed Swipe speed in pixels per second (default: 800). gestureSourceType Which type of input events to be generated (default: 'default', which queries the platform for the preferred input type). repeatCount The number of times to repeat the gesture (default: 0). repeatDelayMs The number of milliseconds delay between each repeat. (default: 250). interactionMarkerName The name of the interaction markers to generate, if not empty (default: "").

Implementation

Future<void> synthesizeScrollGesture(num x, num y,
    {num? xDistance,
    num? yDistance,
    num? xOverscroll,
    num? yOverscroll,
    bool? preventFling,
    int? speed,
    GestureSourceType? gestureSourceType,
    int? repeatCount,
    int? repeatDelayMs,
    String? interactionMarkerName}) async {
  await _client.send('Input.synthesizeScrollGesture', {
    'x': x,
    'y': y,
    if (xDistance != null) 'xDistance': xDistance,
    if (yDistance != null) 'yDistance': yDistance,
    if (xOverscroll != null) 'xOverscroll': xOverscroll,
    if (yOverscroll != null) 'yOverscroll': yOverscroll,
    if (preventFling != null) 'preventFling': preventFling,
    if (speed != null) 'speed': speed,
    if (gestureSourceType != null) 'gestureSourceType': gestureSourceType,
    if (repeatCount != null) 'repeatCount': repeatCount,
    if (repeatDelayMs != null) 'repeatDelayMs': repeatDelayMs,
    if (interactionMarkerName != null)
      'interactionMarkerName': interactionMarkerName,
  });
}