Created
June 17, 2019 10:10
-
-
Save flutter-devs/6b79ccd39b8653c7317c15d030de38cd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DragTarget( | |
builder: (context, List<String> candidateData, rejectedData) { | |
return Center( | |
child: isSuccessful | |
? Padding( | |
padding: EdgeInsets.only(top: 100.0), | |
child: Container( | |
color: Colors.yellow, | |
height: 200.0, | |
width: 200.0, | |
child: Center( | |
child: FlutterLogo( | |
size: 100.0, | |
)), | |
), | |
) | |
: Container( | |
height: 200.0, | |
width: 200.0, | |
color: Colors.yellow, | |
), | |
); | |
}, | |
onWillAccept: (data) { | |
return true; | |
}, | |
onAccept: (data) { | |
setState(() { | |
isSuccessful = true; | |
}); | |
}, | |
), |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment