dispatchDragEvent method
Dispatches a drag event into the page.
type
Type of the drag event.
x
X coordinate of the event relative to the main frame's viewport in CSS pixels.
y
Y coordinate of the event relative to the main frame's viewport in CSS pixels. 0 refers to
the top of the viewport and Y increases as it proceeds towards the bottom of the viewport.
modifiers
Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8
(default: 0).
Implementation
Future<void> dispatchDragEvent(
@Enum(['dragEnter', 'dragOver', 'drop', 'dragCancel']) String type,
num x,
num y,
DragData data, {
int? modifiers,
}) async {
assert(
const ['dragEnter', 'dragOver', 'drop', 'dragCancel'].contains(type),
);
await _client.send('Input.dispatchDragEvent', {
'type': type,
'x': x,
'y': y,
'data': data,
if (modifiers != null) 'modifiers': modifiers,
});
}