Flutter: Is it possible to change the mouse cursor for `feedback` widget of `Draggable` widget?

Viewed 18

While dragged widget is dragging I would like to change the cursor to more appropriate SystemMouseCursor.grabbing but unfortunately it is not possible to do this by simple Flutter facilities. Maybe someone already had such experience?

1 Answers

After some brain storming I found the enough simple solution. All what need to be done is wrap the childWhenDragging widget with MouseRegion:

Draggable(
  feedback: <dragging widget>,
  childWhenDragging: Container(
    color: Theme.of(context).colorScheme.secondary.withOpacity(0.1),
    child: MouseRegion(
      cursor: SystemMouseCursors.grabbing,
      child: <draggable child>,
    ), 
  ),
)
Related