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>
For String returns : 

```
enum Routes{
  SPLASH_SCREEN,
  HOME,
  // TODO Add according to your context
}

String namedRoute(Routes route){
  final runtimeType = '${route.runtimeTypes.toString()}.';
  final output = route.toString();
  return output.replaceAll(runtimeType, "");
}

```