Draggable Mouse Cursor
Asked Answered
A

1

7

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?

Anachronistic answered 14/2, 2021 at 12:7 Comment(1)
I opened an issue related to this problem: github.com/flutter/flutter/issues/92083Spermous
J
1

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

Jocko answered 24/9, 2022 at 13:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.