Question: In Java when you are defining an enum, you can do something similar to the following, i.e. add members to an `enum`. Is this possible in Dart?

```dart
enum Foo {
  one(1), two(2);
  final num value;
  Foo(this.value);
}

```

Answer: 
Starting with Dart 2.6 you can define extensions on classes (Enums included).

```
enum Cat {
  black,
  white
}

extension CatExtension on Cat {

  String get name {
    switch (this) {
      case Cat.black:
        return 'Mr Black Cat';
      case Cat.white:
        return 'Ms White Cat';
      default:
        return null;
    }
  }

  void talk() {
    print('meow');
  }
}

```

Example:

```
Cat cat = Cat.black;
String catName = cat.name;
cat.talk();

```

Here's one more live example (uses a constant map instead of a switch):
<https://dartpad.dartlang.org/c4001d907d6a420cafb2bc2c2507f72c>
There's an upcoming feature in Dart known as enhanced enums, and it allows for enum declarations with many of the features known from classes. For example:

```dart
enum Blah {
  one(1), two(2);
  final num value;
  const Blah(this.value);
}

```

The feature is not yet released (and note that several things are not yet working), but experiments with it can be performed with a suitably fresh version of the tools by passing `--enable-experiment=enhanced-enums`.

The outcome is that `Blah` is an enum declaration with two values `Blah.one` and `Blah.two`, and we have `Blah.one.value == 1` and `Blah.two.value == 2`. The current bleeding edge handles this example in the common front end (so `dart` and `dart2js` will handle it), but it is not yet handled by the analyzer.