title: How to implement event listener or delegate on flutter
body: <p>I have a main dart class in which the app bar is located and the app bar contains a refresh button. I'm using a navigation drawer to populate two other views f1 and f2.</p>
  
  <p>From my main.dart how can I pass the refresh button clicks to the sub fragment kind of f1.dart so that I can refresh my contents on f1.dart</p>
  
  <pre><code>// State of Main
  class _MyHomePageState extends State&lt;MyHomePage&gt; {
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        drawer: Drawer(
          child: new Column(
            children: &lt;Widget&gt;[
  
  ////////////////////////////////////////////////////////////
                  new FirstFragment(),
                  new SecondFragment()
  /////////////////////////////////////////////////////////////
            ],
          ),
        ),
        appBar: AppBar(
          title: Text(widget.title),
          actions: &lt;Widget&gt;[
            IconButton(
              icon: Icon(Icons.refresh),
              onPressed: () {
                print("refresh pressed");
  /////////////////////////
           How to send this refresh pressed event to my FirstFragment class??
  /////////////////////////
              },
              color: Colors.white,
            )
          ],
        ),
        body: _getDrawerItemWidget(_selectedDrawerIndex),
      );
    }
  
  }
  </code></pre>
  
  <p>In Android, I've been using event listeners and for iOS, I can use delegates for the purpose. How can I achieve this on flutter/dart. ?</p>