Last active
October 26, 2019 10:18
-
-
Save hl3hl3/15a4e33609b97cb5197b5298c5cdacd6 to your computer and use it in GitHub Desktop.
DragTarget example
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, candidateData, rejectedData) { | |
return Container( | |
width: 200, | |
height: 200, | |
color: _acceptedColor, | |
); | |
}, | |
onWillAccept: (MaterialColor data) { | |
debugPrint('onWillAccept()'); | |
return true; | |
}, | |
onAccept: (MaterialColor data) { | |
debugPrint('onAccept()'); | |
setState(() { | |
_acceptedColor = data; | |
}); | |
}, | |
onLeave: (MaterialColor data) { | |
debugPrint('onLeave()'); | |
setState(() { | |
_acceptedColor = Colors.grey; | |
}); | |
}, | |
), |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment