title: Handle item click of dynamic Expandable list in flutter
body: <p>I have dynamic lists inside the dynamic list, My need is to save option with their attributes. I tried so many ways to show drop down of attributes for every option but <code>DropDownMenuitem</code> Widgets does not handle dynamic list in the stable version of flutter, so I have to use Expandable List for this purpose. When I select an attribute of an option then how can I reflect the selection of a particular option in the header or how can I save the selection of dynamic attribute</p>
  
  <p>This is how i build my list</p>
  
  <pre><code>ListView.builder(
                  shrinkWrap: true,
                  itemCount: opAtrrList.length&gt;0?opAtrrList.length:0,
                  itemBuilder: (context, i) {
                    return ExpansionTile(
                      title:optionTitle(width,height,opAtrrList[i].groupname,selectedAttr),
                      children: &lt;Widget&gt;[
                        new Column(
                          children: _buildExpandableContent(opAtrrList[i]),
                        ),
                      ],
                    );
                  },
                ),
  </code></pre>
  
  <p>This is my expandable item <strong><code>Attribute selectedAttr;</code></strong></p>
  
  <pre><code>_buildExpandableContent(OptionAttribute oa) {
        List&lt;Widget&gt; columnContent = [];
        for(int i=0;i&lt;oa.attrlist.length;i++){
          columnContent.add(
            new ListTile(
              onTap: (){
                setState(() {
                  selectedAttr=oa.attrlist[i];
                });
              },
              title: new Text(oa.attrlist[i].attributename, style: TextStyle(fontFamily: 'medium',color: MyColors.colorPrimaryDark)),
            ),
          );
        }
        return columnContent;
      }
  </code></pre>
  
  <p>Please see the below gif.</p>
  
  <p><a href="https://i.stack.imgur.com/sYom4.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sYom4.gif" alt="enter image description here"></a></p>