Revert "Draggable can be accepted when the data is null" (#99419)

This commit is contained in:
Kate Lovett
2022-03-02 12:31:11 -06:00
committed by GitHub
parent 4b20ce74e3
commit f8eee10f96
4 changed files with 37 additions and 130 deletions

View File

@@ -16,9 +16,9 @@ class ExampleDragTarget extends StatefulWidget {
class ExampleDragTargetState extends State<ExampleDragTarget> {
Color _color = Colors.grey;
void _handleAccept(Color? data) {
void _handleAccept(Color data) {
setState(() {
_color = data!;
_color = data;
});
}
@@ -215,7 +215,7 @@ class MovableBall extends StatelessWidget {
);
} else {
return DragTarget<bool>(
onAccept: (bool? data) { callback(position); },
onAccept: (bool data) { callback(position); },
builder: (BuildContext context, List<bool?> accepted, List<dynamic> rejected) {
return dashedBall;
},