title: Dart - Constrain a generic type (T) to an Enum
body: <p>Is there a way to constrain a generic type to be an <code>enum</code>, something like the following?</p>
  
  <pre class="lang-dart prettyprint-override"><code>class MyClass&lt;T extends enum&gt; {}
  </code></pre>
  
  <p>Something like <a href="https://stackoverflow.com/questions/79126/create-generic-method-constraining-t-to-an-enum/8086788#8086788">this in C#</a>.</p>