registerCustomEnum static method

void registerCustomEnum(
  1. String typeName,
  2. List<String> fields, {
  3. List<String>? values,
})

Register custom enum types and their fields manually. This replaces the slow introspection.

Implementation

static void registerCustomEnum(String typeName, List<String> fields,
    {List<String>? values}) {
  _knownEnumTypes.add(typeName);
  for (final field in fields) {
    _fieldToEnumType[field] = typeName;
  }
  if (values != null) {
    _customEnumValues[typeName] = values.toSet();
  }
}