title: Emit the data to parent Widget in Flutter
body: <p>I'm trying to set the text from child widget to parent widget. But the text is not reflecting in parent widget. </p>
  
  <p>Tried to use setState() also but still unable to get expected result.</p>
  
  <p>Following is my code:</p>
  
  <pre><code>void main() =&gt; runApp(new TestApp());
  
  class TestApp extends StatefulWidget {
    @override
    _TestState createState() =&gt; new _TestState();
  }
  
  class _TestState extends State&lt;TestApp&gt;{
  
    String abc = "";
  
    @override
    Widget build(BuildContext context) {
      return new MaterialApp(
        home: new Scaffold(
          body: new Column(
            children: &lt;Widget&gt;[
              new Text("This is text $abc"),
              TestApp2(abc)
            ],
          ),
        ),
      );
    }
  }
  
  
  class TestApp2 extends StatefulWidget {
  
    String abc;
  
    TestApp2(this.abc);
  
    @override
    _TestState2 createState() =&gt; new _TestState2();
  }
  
  class _TestState2 extends State&lt;TestApp2&gt;{
    @override
    Widget build(BuildContext context) {
      return new Container(
        width: 150.0,
        height: 30.0,
        margin: EdgeInsets.only(top: 50.0),
        child: new FlatButton(
            onPressed: (){
              setState(() {
                widget.abc = "RANDON TEXT";
              });
            },
          child: new Text("BUTTON"),
          color: Colors.red,
        ),
      );
    }
  }
  </code></pre>
  
  <p>Am i missing something ?</p>