Start a Project

Draggable Widget in Flutter

Draggable Widget in Flutter, basically “Draggable” means ‘Something that can be moved from one point to another’.

It is used to drag a widget to a DragTarget.

You may check out some of our best Flutter app development services.

Properties of Draggable Widget

Here, child and feedback are the required properties within the Draggable Widget.

Code for Draggable Widget

Here’s the complete code–>

Here’s the final output of the code-

It is the basic layout when the user has not started the dragging of the widget.

When the widget is being dragged

When the widget is completely dragged it receives the data and displays it

We can send any type of data in the “data” property.

Conclusion

In this blog, we have discussed how we can Drag Widgets on our App screen.

I hope it will help you out in understanding and get a brief idea about it.

You may check our other blogs – https://mobikul.com/blog/

Thank you for reading!!

References

https://medium.com/flutter-community/a-deep-dive-into-draggable-and-dragtarget-in-flutter-487919f6f1e4

https://api.flutter.dev/flutter/widgets/Draggable-class.html

Exit mobile version