title: How do I get rid of "Incorrect use of ParentDataWidget" error?
body: <p>I can't avoid the &quot;Incorrect use of ParentDataWidget&quot; error. The code below works - I want to be able to drop a draggable widget onto a dragTarget in the bottomSheet, but also want the widget to be draggable in the body.</p>
  <p>The code works fine in the emulator, but when the draggable is accepted on the dragTarget, the error is flagged up in the console.</p>
  <p>Is there something obvious that I'm doing wrong?</p>
  <pre><code>
  void main() =&gt; runApp(MyApp());
  
  bool isAccepted = false;
  DragMe niceBox = new DragMe('Hello', 50.0, 100.0, Colors.green);
  DragMe nastyBox = new DragMe('Yucky', 150.0, 100.0, Colors.brown[300]);
  TargetBox targetBox = new TargetBox();
  MyDragTarget myDragTarget = new MyDragTarget();
  const kTopSpace = 96; // Height of Appbar plus the icon bar above
  
  class MyApp extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      return MaterialApp(
        theme: ThemeData( fontFamily: 'PressStart'),
        home: MyHomeScreen(),
      );
    }
  }
  
  class MyHomeScreen extends StatefulWidget {
    MyHomeScreen({Key key}) : super(key: key);
    createState() =&gt; MyHomeScreenState();
  }
  
  class MyHomeScreenState extends State&lt;MyHomeScreen&gt; {
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        backgroundColor: Colors.red[100],
        appBar: AppBar(
          toolbarHeight: 70.0,
          title: Center(child: Text('My brain hurts')),
          backgroundColor: Colors.pink,
        ),
        body: Stack(children: [niceBox, nastyBox]),
        bottomSheet: Container(
          color: Colors.lightBlue,
          height: 100.0,
          child: Row(
            mainAxisAlignment: MainAxisAlignment.center,
            mainAxisSize: MainAxisSize.max,
            children: [myDragTarget],
          ),
        ),
      );
    } // End build()
  } // End class MyHomeScreenState
  
  class DragMe extends StatefulWidget {
    DragMe(this.myText, this.xPos, this.yPos, this.myColor);
    final String myText;
    double xPos;
    double yPos;
    final Color myColor;
  
    @override
    _DragMeState createState() =&gt; _DragMeState();
  }
  
  class _DragMeState extends State&lt;DragMe&gt; {
    @override
    Widget build(BuildContext context) {
      return Positioned(
        left: widget.xPos,
        top: widget.yPos,
        // left: widget.xPos,
        // top: widget.yPos,
        child: Draggable(
          data: widget.myText,
          feedback: Container(height: 50, width: 70, color: Colors.grey),
          childWhenDragging: Container(),
          onDragStarted: () {},
          onDragEnd: (details) {
            setState(() {
              widget.xPos = details.offset.dx;
              widget.yPos = details.offset.dy - kTopSpace;
            });
          },
          onDragCompleted: () {},
          onDraggableCanceled: (velocity, offset) {},
          child: Container(
            child: Center(child: Text(widget.myText)),
            color: widget.myColor,
            height: 50,
            width: 70,
          ),
        ),
      );
    }
  }
  
  class MyDragTarget extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      return DragTarget&lt;String&gt;(
        builder: (context, List&lt;String&gt; acceptedData, rejectedData) {
          if (isAccepted) {
            return niceBox;
          } else {
            return targetBox;
          }
        },
        onWillAccept: (data) {
          if (data == 'Hello') {
            isAccepted = true;
            return true;
          } else {
            isAccepted = false;
            return false;
          }
        },
        onAccept: (strData) {},
        onLeave: (strData) {
          return true;
        },
        onMove: (moveData) {
          return true;
        },
        onAcceptWithDetails: (data) {},
      );
    }
  }
  
  class TargetBox extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      return Container(
          child: Center(child: Text('Drop Here')),
          color: Colors.yellow,
          height: 50.0,
          width: 100.0);
    }
  }
  </code></pre>