ComponentField<C extends Component> class final Assets and loading

One declared property, the const descriptor plus the runtime bindings that connect it to a live component. The descriptor travels (schemas, manifests, MCP); the bindings stay in-process.

Constructors

ComponentField(ComponentPropertyDef def, {PropertyValue? read(C component, SerializeContext context)?, void write(C component, PropertyValue value, RealizeContext context)?})
const

Properties

def → ComponentPropertyDef
The portable descriptor (name, kind, default, constraints, docs).
final
hashCode → int
The hash code for this object.
no setterinherited
read → PropertyValue? Function(C component, SerializeContext context)?
Reads the property from a live component, or null for a property that only flows through DeclarativeComponentCodec.create (constructor-only configuration) or is provided by code.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
write → void Function(C component, PropertyValue value, RealizeContext context)?
Applies the property to a live component after create, or null for constructor-only configuration.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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

Static Methods

boolean<C extends Component>(String name, {required bool defaultValue, bool get(C component)?, void set(C component, bool value)?, String? doc, String? group, List<String> formerNames = const [], bool transient = false}) → ComponentField<C>
A boolean property.
enumString<C extends Component, T extends Enum>(String name, {required List<T> values, required T defaultValue, T get(C component)?, void set(C component, T value)?, String? doc, String? group, List<String> formerNames = const [], bool transient = false}) → ComponentField<C>
An enum property carried as its value name string.
integer<C extends Component>(String name, {required int defaultValue, int get(C component)?, void set(C component, int value)?, String? doc, String? group, List<PropertyConstraint<int>> constraints = const [], List<String> formerNames = const [], bool transient = false}) → ComponentField<C>
An integer property.
number<C extends Component>(String name, {required double defaultValue, double get(C component)?, void set(C component, double value)?, String? doc, String? group, List<PropertyConstraint<num>> constraints = const [], List<String> formerNames = const [], bool transient = false}) → ComponentField<C>
A floating-point property.
resourceRef<C extends Component>(String name, {required String resourceKind, LocalId? get(C component, SerializeContext context)?, void set(C component, LocalId id, RealizeContext context)?, String? doc, String? group, List<String> formerNames = const [], bool transient = false}) → ComponentField<C>
A resource reference property. get recovers the source resource id from the live object it was realized into (see resourceOrigin).
string<C extends Component>(String name, {required String defaultValue, String get(C component)?, void set(C component, String value)?, String? doc, String? group, List<PropertyConstraint<String>> constraints = const [], List<String> formerNames = const [], bool transient = false}) → ComponentField<C>
A free-form string property.
vec2<C extends Component>(String name, {required Vector2 defaultValue(), Vector2 get(C component)?, void set(C component, Vector2 value)?, String? doc, String? group, List<PropertyConstraint<Object>> constraints = const [], List<String> formerNames = const [], bool transient = false}) → ComponentField<C>
A Vector2 property.
vec3<C extends Component>(String name, {required Vector3 defaultValue(), Vector3 get(C component)?, void set(C component, Vector3 value)?, String? doc, String? group, List<PropertyConstraint<Object>> constraints = const [], List<String> formerNames = const [], bool transient = false}) → ComponentField<C>
A Vector3 property. Add an RgbColor constraint for linear RGB colors carried as vectors (byte-compatible with existing documents).
vec4<C extends Component>(String name, {required Vector4 defaultValue(), Vector4 get(C component)?, void set(C component, Vector4 value)?, String? doc, String? group, List<String> formerNames = const [], bool transient = false}) → ComponentField<C>
A Vector4 property.