title: Syntax for Passing a Callback into a GestureDetector in Flutter from a Model
body: <p>I am trying to figure out how to pass an onTap callback from one class to another. </p>
  
  <p>I have created a model that I use to build lists with, in that model there is an onTap property, what I would like to do is define which callback to you and then access the on tap from within a view.</p>
  
  <p><strong>The Model which is to hold the callback</strong></p>
  
  <pre><code>class MasterListsModel{
    final ListRowType rowType;
    final String assetName;
    final String name;
    final Color textColor;
    final Color backgroundColor;
    final void onTap; // &lt;&lt;------ The property that holds the callback
  </code></pre>
  
  <p><strong>The list definition example</strong></p>
  
  <pre><code>List&lt;MasterListsModel&gt; rows(Store&lt;PrimeAppStateModel&gt; store){
      List&lt;MasterListsModel&gt; list = [
        new MasterListsModel(
          ListRowType.headlinePrime,
          name: l10n.d1SearchHeader
        ),
        new MasterListsModel(ListRowType.icon,
          name: l10n.d1SearchMembers,
          textColor: hColors.white,
          assetName: hGraphics.segmentIconMembersWhite,
          backgroundColor: hColors.transparent,
          onTap: someVoidCallBackHere // &lt;&lt;----- The callback added to model
        ),
  </code></pre>
  
  <p>then I want evoke the the onTap from inside my list construction class.</p>
  
  <pre><code>return new Container(
        margin: new EdgeInsets.fromLTRB(35.0, 20.0, 0.0, 20.0),
        child: new GestureDetector(
          onTap: masterListModel.onTap, // &lt;&lt; ----- Add callback
          child: new Row(
            children: &lt;Widget&gt;[
              new Container(
  </code></pre>