Inspector class

A widget that renders a table of type-aware editors for one or more Inspectable objects.

When a single object is passed, every property registered in its Inspectable.properties list is shown. When multiple objects are passed, only properties common to all objects (same name and runtime type) are displayed. Fields whose values differ across objects appear blank in the editor; committing a change applies the new value to every object.

Built-in editors are provided for int, double, bool, String, and Enum. Additional editors supplied via editors take precedence over the built-ins. A property can also opt out of the type lookup by specifying a InspectableProperty.customEditor key.

Inheritance

Constructors

Inspector({Key? key, Map<Type, EditorBuilder>? editors, List<Inspectable>? objects, Object? customData, void onUpdatedProperty(List<InspectableProperty> properties, dynamic value)?})
Creates an Inspector.
const

Properties

customData Object?
Arbitrary data passed through to each editor and ultimately to InspectableProperty.setValue on every change.
final
editors Map<Type, EditorBuilder>
Custom editor factories keyed by property Type.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
objects List<Inspectable>
The Inspectable objects whose properties are displayed and edited.
final
onUpdatedProperty → void Function(List<InspectableProperty> properties, dynamic value)?
Called whenever any property value is committed through the inspector.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<StatefulWidget>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

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