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: 
Nope. In Dart, enums can only contain the enumerated items:

```
enum Color {
  red,
  green,
  blue
}

```

However, each item in the enum automatically has an index number associated with it:

```
print(Color.red.index);    // 0
print(Color.green.index);  // 1

```

You can get the values by their index numbers:

```
print(Color.values[0] == Color.red);  // True

```

See: <https://www.dartlang.org/guides/language/language-tour#enums>
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.