ComponentPropertyDef class

A declared, editable property of a component type: the single source of truth for its name, carried kind, default, constraints, and docs.

Constructors

ComponentPropertyDef(String name, ComponentPropertyKind kind, {PropertyValue? defaultValue, String? doc, String? group, String? resourceKind, List<String>? options, List<PropertyConstraint<Object?>> constraints = const [], List<String> formerNames = const [], bool transient = false, ComponentPropertyDef? itemDef, List<ComponentPropertyDef>? objectFields, String unionTag = 'kind', Map<String, List<ComponentPropertyDef>>? unionVariants})
Declares property name of kind.
const

Properties

constraints List<PropertyConstraint<Object?>>
Declared value constraints; see PropertyConstraint.
final
defaultValue PropertyValue?
The value used when the property is absent from a spec, or null for a required property with no default (a mesh's geometry reference).
final
doc String?
A short human/agent-readable description, rendered as a tooltip.
final
formerNames List<String>
Prior names of this property, accepted when loading older documents.
final
group String?
The collapsible inspector section this property belongs to.
final
hardMax double?
The hard inclusive upper bound, from Range/IntRange, or null.
no setter
hardMin double?
The hard inclusive lower bound, from Range/IntRange, or null.
no setter
hashCode int
The hash code for this object.
no setterinherited
itemDef ComponentPropertyDef?
For ComponentPropertyKind.list, the entry descriptor (name unused).
final
kind ComponentPropertyKind
The property's editable type.
final
name String
The property key in the component spec's properties bag.
final
objectFields List<ComponentPropertyDef>?
For ComponentPropertyKind.object, the nested field descriptors.
final
options List<String>?
For ComponentPropertyKind.string enums, the allowed values.
final
resourceKind String?
For ComponentPropertyKind.resourceRef, the referenced resource kind (geometry, material, texture, environment), so an editor can filter the picker.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
transient bool
Schema-visible but never persisted (runtime state, or code-provided).
final
unionTag String
For ComponentPropertyKind.union, the map key holding the variant tag.
final
unionVariants Map<String, List<ComponentPropertyDef>>?
For ComponentPropertyKind.union, the field descriptors per variant.
final

Methods

constraint<C extends PropertyConstraint<Object?>>() → C?
The first constraint of type C, or null.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, Object?>
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

fromJson(Map<String, Object?> json) ComponentPropertyDef