Check Mobile App
Read now
Start a Project

Draggable Widget in Flutter

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.

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 getting a brief idea about it.

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

. . .

Leave a Comment

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


Be the first to comment.

css.php

The support is fast and do everything in their power to make it perfect. If you need customization it's also done right away. I had massive research to select Mobikul and now I'm sure it was the right one.

Igor Souza

Igor Souza

Talk to Sales

Global

Live Chat
Start a Project

    Message Sent!

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

    Back to Home