title: How to bind an enum to DropdownButton in Flutter?
body: <p>Is it possible to bind a dropdownbutton to an enum? I have created an enum and trying to bind it to a dropdownbutton, see code below. Thanks for any help on this.</p>
  <pre class="lang-dart prettyprint-override"><code>enum ClassType {
    Class-A,
    Class-B,
    Class-C,
    Class-D
  }
  
  DropdownButton&lt;String&gt;(
      value: classType,
      onChanged: (String newValue) {
          setState(() {
              viewModel.classType = newValue;
              });
          },
      items: ClassType.map((String classType) {
          return DropdownMenuItem&lt;String&gt;(
              value: classType,
              child: Text(classType),
          );
     }).toList(),
  )
  </code></pre>