InspectableProperty<T> class
Describes a single inspectable field of type T on an Inspectable object.
An InspectableProperty pairs a getter/setter with metadata that controls how the Inspector widget presents and validates the value:
- readOnly — renders the editor as non-interactive.
- nullable — allows
null; bool editors render in tristate mode. - clamp — min/max range; double editors render a Slider.
- values — fixed set of allowed values; used by enum/dropdown editors.
- customEditor — key that selects a per-property custom editor.
- getSubProperties — returns nested descriptors for hierarchical inspection.
Constructors
-
InspectableProperty({required String name, required T? getValue(Inspectable obj), void setValue(Inspectable obj, dynamic value, Object? customData)?, List<
T> values()?, (T, T)? clamp, bool readOnly = false, bool nullable = false, List<InspectableProperty> getSubProperties(Inspectable obj)?, String? customEditor}) - Creates an InspectableProperty descriptor.
Properties
- clamp ↔ (T, T)?
-
Optional inclusive (min, max) range for numeric properties.
getter/setter pair
- customEditor ↔ String?
-
Key used to look up a per-property custom editor in the Inspector
editors map, overriding the type-based lookup.
getter/setter pair
-
getSubProperties
↔ List<
InspectableProperty> Function(Inspectable obj)? -
Returns nested InspectableProperty descriptors for a sub-object.
getter/setter pair
- getValue ↔ T? Function(Inspectable obj)
-
Reads the current value of this property from
obj.getter/setter pair - hashCode → int
-
The hash code for this object.
no setterinherited
- name ↔ String
-
The label displayed for this property in the inspector table.
getter/setter pair
- nullable ↔ bool
-
Whether this property accepts
nullas a valid value.getter/setter pair - readOnly ↔ bool
-
Whether this property should be rendered as read-only in the inspector.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- setValue ↔ void Function(Inspectable obj, dynamic value, Object? customData)?
-
Writes
valueback toobj.getter/setter pair - type → Type
-
The Dart Type of this property, derived from the generic parameter
T.no setter -
values
↔ List<
T> Function()? -
Returns the exhaustive list of allowed values for this property.
getter/setter pair
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