Skip to main content

Posts

Showing posts from March, 2019

Drag and Drop Demo for flutter

In this tutorial we will be discussing drag and drop items. First, we will create a new folder. Right click on the ‘ drag_and_drop ’ folder, new /Directory . Enter the directory name, in my case I used ‘images’ , look up the image that you want to use. Copy the image and paste it on the folder. Go to ‘ pubspec.yalm ’ under the comment section write ‘ assets:’  a dash and the name of the folder in my case it’s called ‘images’ then the name of the image. (example below) After doing this we will now begin to work on the draggable item. Draggable is a class and it has a widget that can be dragged. In the main we will execute MyApp , which is a class that returns a MaterialApp and the part that we will be working on is the ‘body’ the body calls the ‘App( )’ . Creating the Dragbox…Our dragbox will have three variables: the initial position, a label and a color. And the constructor. The App( ) class and the AppState( ) class… T...