isEnum function

bool isEnum(
  1. dynamic data
)

Implementation

bool isEnum(dynamic data) {
  if (data.runtimeType == "".runtimeType) {
    return false;
  }
  final split = data.toString().split('.');
  return split.length > 1 && split[0] == data.runtimeType.toString();
}