Checks if the given DartType is an enum.
static bool isEnumType(DartType type) { return type is InterfaceType && type.element is EnumElement; }