title: How to create custom dropdownlist in Flutter?
body: <p>I am still learning Flutter and I am trying to create a custom dropdownlist. Below is my custom dropdownlist and it seems to work and return the selected value but I  still need help on how to show popup list when the inkwell is pressed. Also, how do I pass in a string array to build/populate the popup list items. Thanks for your help on this.</p>
  
  <pre><code>return new Expanded(
      flex: 4,
      child: new InputDropdownList(
        labelText: "Select a value",
        valueText: viewModel.selectedValue,
        valueStyle: Theme.of(context).inputDecorationTheme.labelStyle,
        items: &lt;String&gt;["ValueA", "ValueB", "ValueC", "ValueD"],
        onPressed: () { 
        },
        selectedValue: (String value) { 
          setState(() { viewModel.selectedValue= value; });
        },
      ),
  ),
  
  
  class InputDropdownList extends StatelessWidget {
    const _InputDropdownList({
      Key key,
      this.labelText,
      this.valueText,
      this.valueStyle,
      this.items,
      this.onPressed,
      this.selectedValue }) : super(key: key);
  
    final String labelText;
    final String valueText;
    final TextStyle valueStyle;
    final List&lt;String&gt; items;
    final Function() onPressed;
    final ValueChanged&lt;String&gt; selectedValue;
  
    @override
    Widget build(BuildContext context) {
      return new InkWell(
        onTap: () {},
        child: new InputDecorator(
          decoration: new InputDecoration(
            labelText: labelText,
          ),
          baseStyle: valueStyle,
          child: new Row(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            mainAxisSize: MainAxisSize.min,
            children: &lt;Widget&gt;[
              new Text(valueText, style: valueStyle),
              new PopupMenuButton&lt;String&gt;(
                icon: new Icon(Icons.arrow_drop_down, color: Theme.of(context).brightness == Brightness.light ? Colors.grey.shade700 : Colors.white70),
                padding: EdgeInsets.zero,
                onSelected: (value) {
                  selectedValue(value);
                },
                itemBuilder: (BuildContext context) =&gt; &lt;PopupMenuItem&lt;String&gt;&gt;[
                  new PopupMenuItem&lt;String&gt;(
                    value: "ValueA",
                    child: const Text('ValueA')
                  ),
                  new PopupMenuItem&lt;String&gt;(
                    value: "ValueB",
                    child: const Text('ValueB')
                  ),
                ]
              ),
            ],
          ),
        ),
      );
    }
  }
  </code></pre>