moveBy method
Send a move event moving the pointer by the given offset.
If the pointer is down, then a move event is dispatched. If the pointer is up, then a hover event is dispatched.
See also:
- WidgetController.drag, a method to simulate a drag.
- WidgetController.timedDrag, a method to simulate the drag of a given widget in a given duration. It sends move events at a given frequency and it is useful when there are listeners involved.
- WidgetController.fling, a method to simulate a fling.
Implementation
Future<void> moveBy(Offset offset, { Duration timeStamp = Duration.zero }) {
assert(_pointer.location != null);
if (_pointer.isPanZoomActive) {
return panZoomUpdate(
_pointer.location!,
pan: (_pointer.pan ?? Offset.zero) + offset,
timeStamp: timeStamp
);
} else {
return moveTo(_pointer.location! + offset, timeStamp: timeStamp);
}
}