move method

PointerMoveEvent move(
  1. Offset newLocation, {
  2. Duration timeStamp = Duration.zero,
  3. int? buttons,
})

Create a PointerMoveEvent to the given location.

By default, the time stamp on the event is Duration.zero. You can give a specific time stamp by passing the timeStamp argument.

isDown must be true when this is called, since move events can only be generated when the pointer is down.

By default, the set of buttons in the last down or move event is used. You can give a specific set of buttons by passing the buttons argument.

Implementation

PointerMoveEvent move(
  Offset newLocation, {
  Duration timeStamp = Duration.zero,
  int? buttons,
}) {
  assert(
      isDown,
      'Move events can only be generated when the pointer is down. To '
      'create a movement event simulating a pointer move when the pointer is '
      'up, use hover() instead.');
  assert(!isPanZoomActive);
  final Offset delta = newLocation - location!;
  _location = newLocation;
  if (buttons != null) {
    _buttons = buttons;
  }
  return PointerMoveEvent(
    timeStamp: timeStamp,
    kind: kind,
    device: _device,
    pointer: pointer,
    position: newLocation,
    delta: delta,
    buttons: _buttons,
  );
}