flet icon indicating copy to clipboard operation
flet copied to clipboard

feature: For ft. DragTarget() component adds event throttling,Very important

Open Qye-Leisure opened this issue 6 months ago • 2 comments

Duplicate Check

  • [x] I have searched the opened issues and there are no duplicates

Describe the requested feature

The dragging of the ft.Draggable() component is very smooth, but due to the communication latency between Python and Flutter, the data return of the on_move and on_accept events of the ft.DragTarget() component, as well as the on_drag_complete event of the ft.Draggable() component, suffers from very severe delays in complex page scenarios. This directly impairs the usability of the components. I hope to add throttling to the returned data of these events—for example, returning data every xx milliseconds—which can greatly improve the usability of the components. This provides a very powerful improvement for smooth usage. Ideally, the data return of the on_accept event should be isolated from the on_move event, because on_accept only needs to return data once, whereas on_move needs to return data in real time. Currently, the on_accept data return delay is very serious, and I suspect it is affected by the on_move delay.
This is a very important optimization, as it can deliver a very smooth experience with the simplest adjustment.

Suggest a solution

No response

Screenshots

No response

Additional details

No response

Qye-Leisure avatar May 12 '26 02:05 Qye-Leisure

https://github.com/user-attachments/assets/7585d9ef-5741-4e9e-8bb6-14b4d0e693c4

Qye-Leisure avatar May 12 '26 03:05 Qye-Leisure

Before this, flet could barely handle drag-and-drop interactions in complex scenarios — no matter what optimization was applied, it would always be extremely laggy. But the smooth dragging performance of the ft.Draggable() component made me see the possibility of flet tackling complex drag interactions. Once this adjustment is made, flet will be able to rely on ft.Draggable() to handle complex drag-and-drop scenarios with ease. This is absolutely an expansion of the boundaries for flet's application scenarios.

Qye-Leisure avatar May 12 '26 06:05 Qye-Leisure