getName method

String? getName(
  1. O? enumInstance
)

Returns the name of enumInstance.

Implementation

String? getName(O? enumInstance) {
  if (enumInstance == null) {
    return null;
  }

  for (var e in valuesByName.entries) {
    if (e.value == enumInstance) {
      return e.key;
    }
  }

  return null;
}