Skip to content

Instantly share code, notes, and snippets.

@flutter-devs
Created June 17, 2019 10:10
Show Gist options
  • Save flutter-devs/6b79ccd39b8653c7317c15d030de38cd to your computer and use it in GitHub Desktop.
Save flutter-devs/6b79ccd39b8653c7317c15d030de38cd to your computer and use it in GitHub Desktop.
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