Inspectable mixin

Mixin that gives a class runtime property inspection capabilities.

Mix this into any class and populate properties — typically inside the constructor — with InspectableProperty descriptors for each field you want to expose. The Inspector widget will read these descriptors to render type-aware editors automatically.

class Enemy with Inspectable {
  int health = 100;

  Enemy() {
    properties.add(
      InspectableProperty<int>(
        name: 'health',
        getValue: (obj) => health,
        setValue: (obj, value, _) => health = value,
      ),
    );
  }
}

Properties

hashCode int
The hash code for this object.
no setterinherited
properties List<InspectableProperty>
The list of inspectable property descriptors for this object.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

getProperty(String name) InspectableProperty?
Returns the first property whose InspectableProperty.name matches name, or null if no such property exists.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeProperty(String name) → void
Removes the property with the given name from properties.
toString() String
A string representation of this object.
inherited

Operators

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