Draggable Widget in Flutter

Updated 27 April 2023

Save

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

author
. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


Be the first to comment.

Start a Project


    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home