describeEnum function

String describeEnum(
  1. Object enumEntry
)

Converts an enum entry to a string by stripping the enum type name. This method is used to return the name of the enum value without its type prefix.

Implementation

String describeEnum(Object enumEntry) {
  final String description = enumEntry.toString();
  final int indexOfDot = description.indexOf('.');
  assert(indexOfDot != -1 && indexOfDot < description.length - 1);
  return description.substring(indexOfDot + 1);
}