DVDragDrop class

Constructors

DVDragDrop()
const

Properties

canDragOut → bool
Whether this target can drag something out to another application.
no setter
draggingOver → Stream<bool>
True when a drag comes over the window, false when it leaves or is dropped, while the window is accepting (so a page can show where to drop). One true per drag, however far it moves.
no setter
dropped → Stream<DVDropEvent>
Every drop the application took, whichever window or widget took it.
no setter
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
startsDrags → bool
Whether Dart starts a drag out (dragDrop.startDrag). Where only dragDrop.setPending exists (a browser) the platform starts its own drag from the press, and startDrag cannot start one.
no setter
supported → bool
Whether this target can take drops at all. Where it cannot, chooseInstead is the way in.
no setter

Methods

accept({List<DVDropType> types = DVDropType.values, void onDrop(DVDropEvent event)?}) → Future<void>
Takes drops of types anywhere on the window, running onDrop for each.
chooseInstead({bool multiple = true, String type = 'any'}) → Future<DVDropEvent?>
Where a target has no drag and drop, the same files arrive by choosing them: opens the file picker and delivers the choice as a drop, to the window handler and the dropped stream. Returns the event, or null when nothing was chosen.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
startDrag(DVDragPayload payload, {double x = 0, double y = 0}) → Future<bool>
Starts a drag out of the application carrying payload.
stop() → Future<void>
Stops taking drops on the window. Widget targets keep theirs.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Properties

accepting → bool
Whether the window is taking drops.
no setter
pendingPayload ↔ DVDragPayload?
What a drag starting now will carry. Set by a draggable widget when a pointer goes down on it, because some platforms ask for the payload at the moment their own drag begins rather than when Dart starts it.
getter/setter pair

Static Methods

addTarget(DVDropTargetRegistration registration) → Future<void>
For widgets: claim drops that land inside registration's bounds. Turns on the window's drop handling where the platform needs that.
dispatch(DVDropEvent event) → void
For platform bindings: something was dropped at the event's position.
dispatchHover(double x, double y) → void
For platform bindings: a drag is over the window at (x, y). Lets a widget target show that it would take the drop.
dispatchLeave() → void
For platform bindings: the drag left the window, or was cancelled.
removeTarget(DVDropTargetRegistration registration) → void
reset() → void