superlistapp / super_native_extensions

Native drag & drop, clipboard access and context menu.
MIT License
441 stars 76 forks source link

[super_drag_and_drop] Dragging of Offscreen Items #354

Open anlumo opened 4 months ago

anlumo commented 4 months ago

I've implemented a sliver-based scrollable grid view with a selection, and when dragging items all selected ones have to be dragged along, including the ones that are scrolled outside of the currently visible view.

It appears that super_drag_and_drop doesn't support this use case. Drag items have to be widgets, but offscreen items aren't part of the widget tree, and so there is no widget for them. I can provide another widget for the drag item via DragItemWidget's dragBuilder, but I'm running into problems there:

I couldn't find a way to make this work, am I missing something?

knopp commented 4 months ago

If you have a specific use case like this you might want to look at the lower level BaseDraggableWidget, which lets you build the entire DragConfiguration independent of widgets.

anlumo commented 4 months ago

Thank you for the response! Unfortunately, the documentation for this class is rather lackluster, so it's taking a while to understand how to use it.