Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Draggable Mouse Cursor

How do I get the mouse cursor to become SystemMouseCursors.grabbing while a draggable is mid-flight?

This is what I have so far.

return Draggable(
      data: data,
      onDragCompleted: () {
        setState(() {
          data = widget.create();
        });
      },
      child: MouseRegion(
        cursor: SystemMouseCursors.grab,
        child: child: child,
      ),
      childWhenDragging: MouseRegion(
        cursor: SystemMouseCursors.grabbing,
        child: child,
      ),
      feedback: MouseRegion(
        cursor: SystemMouseCursors.grabbing,
        child: child,
      )
    );

With this the cursor acts correctly when hovering and not dragging (SystemMouseCursors.grab) and if you don't move your mouse from the origin but grab (SystemMouseCursors.grabbing).

However as soon as you drag it away from the origin it goes straight back to the SystemMouseCursors.basic.

How do I get the cursor to be SystemMouseCursors.grabbing throughout the draggable's flight?

like image 801
Varun Latthe Avatar asked Jul 03 '26 21:07

Varun Latthe


1 Answers

I had same issue, I just set ignoringFeedbackPointer: false in the Draggable widget and it worked.

like image 69
Hassan Jawad Avatar answered Jul 06 '26 11:07

Hassan Jawad



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!