title: Dart: Extension method on enum doesn't work "The method isn't defined for the class"
body: <p>basend <a href="https://stackoverflow.com/questions/38908285/add-methods-or-values-to-enum-in-dart">this Question</a> I created an enum in dart with an extension methode:</p>
  
  <pre class="lang-dart prettyprint-override"><code>enum TagVisibility {
    public,
    shared,
    private,
  }
  
  extension on TagVisibility {
    String get german {
      switch(this){
        case TagVisibility.public: return "Für alle sichtbar";
        case TagVisibility.shared: return "Für alle mit demselben Tag sichtbar";
        case TagVisibility.private: return "Nur für mich sichtbar";
        default: throw Exception("enum has more cases");
      }
    }
  }
  </code></pre>
  
  <p>But I get the error <code>Error: The method 'german' isn't defined for the class 'TagVisibility'.</code> when I try to call this extension method:</p>
  
  <pre class="lang-dart prettyprint-override"><code>import 'package:prototype/models/visibility.dart';
  ...
   DropdownButton&lt;TagVisibility&gt;(
            hint: Text("Wähle die Sichtbarkeit für diesen Tag"),
            value: _visibility ?? _visibilityDefault,
            onChanged: (visibility) {
              setState(() {
                _visibility = visibility;
              });
            },
            // items: List&lt;DropdownMenuItem&lt;TagVisibility&gt;&gt;(
            items: TagVisibility.values.map((visibility) =&gt; DropdownMenuItem(
              value: visibility,
              child: Text('${visibility.german()}'), // doesn't work
              // child: Text('${visibility.toString()}'), // works, but I want the custom messages.
            ),
            ).toList(),
          ),
  </code></pre>
  
  <p>I have absolutly no idea what I did wrong here. Can you please explain me how I can get this working? Thx!</p>