79204331

Date: 2024-11-19 16:49:01
Score: 3.5
Natty:
Report link

Well, looking inside the drag_taget.dart file we can find that _lastOffset is the return value in details.offset.

_lastOffset = globalPosition - dragStartPoint;

And here is the problem. When we are dragging a panel over a dragTarget and we watch details.offset in onMove: (details){ is the _lastOffset value that we are receiving.

So imagine if we have one draggable in the left of the screen and a dragTarget in the right. When we click over and hold and drag this container until it hover the dreagTarget to fire the onMove event, we are receiving all this space between where we clicked less where we hover the target.

If we just do it: _lastOffset = globalPosition; everything works fine but change the original code doesn't seen a good idea.

In data of the draggable we can set the dragStartPoint in details.data.startDragPoint and then subtract it from the details.offset for instance.

-->Pskink, you are a master here, so your opinion is important, what do you think?

Thank you!

Reasons:
  • Blacklisted phrase (0.5): Thank you
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Self-answer (0.5):
  • Looks like a comment (1):
  • Low reputation (0.5):
Posted by: Alexandre B.