registerValueSpecType method

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

Method for registering an object property, whose resolver requires a value for its execution. eg: ImageProvider needs the path or url.

Implementation

@nonVirtual
void registerValueSpecType(String name, ValueSpecBuildFunction 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);
    }
  }
}