List<String> parseEnumType(String type)

Source

List<String> parseEnumType(String type) {
  if (!type.startsWith("enum[") || !type.endsWith("]")) {
    throw new FormatException("Invalid Enum Type");
  }
  return type
      .substring(4, type.length - 1)
      .split(",")
      .map((it) => it.trim())
      .toList();
}