registerSpecType method

  1. @nonVirtual
void registerSpecType(
  1. String name,
  2. SpecBuildFunction func,
  3. Map<String, EditorPropertyType> properties, {
  4. Map<String, Map<String, EditorPropertyType>>? subTypes,
})

Method for registering a property which itself has properties. eg: BoxDecoration, TextStyle

Implementation

@nonVirtual
void registerSpecType(String name, SpecBuildFunction func,
    Map<String, EditorPropertyType> properties,
    {Map<String, Map<String, EditorPropertyType>>? subTypes}) {
  _propertyBuilders[name] = func;
  _schema[name] = EditorSpecProperty(properties,
      abstract: subTypes != null && subTypes.isNotEmpty);
  if (subTypes != null) {
    for (var subType in subTypes.keys) {
      _schema[subType] =
          EditorSpecProperty(subTypes[subType], baseType: name);
    }
  }
}