InteractiveSelector class abstract

An abstract representation of a selector used to identify SVG elements or groups.

Subclasses implement a selection strategy (for example, matching by element name/id or by parent relationship). An InteractiveSelector carries:

  • id: the identifier used to match elements (semantic meaning depends on implementation),
  • label: a human-friendly name used for debugging or display (defaults to id),
  • tag: the XML element name to target (e.g. 'path', 'g', 'rect'). Use '*' to search all tags.
  • type: whether the region is touchable or view-only.

Important: the selector API returns a matched XmlNode (or null) rather than a boolean. Implementations should return the first matching descendant node (or null when no match). This allows callers to obtain the actual node to render or inspect.

Implementers
Annotations

Constructors

InteractiveSelector({required String id, String label = '', InteractiveType type = InteractiveType.viewOnly, String tag = '*'})
Creates an InteractiveSelector.
const
InteractiveSelector.byID({required String id, String? label, InteractiveType type, String tag})
Factory constructor for a selector that matches elements by their id attribute.
const
factory
InteractiveSelector.byIDAndParent({required String id, required InteractiveSelector parentSelector, String? label, InteractiveType type, String tag})
Factory constructor for a selector that matches elements by id and a parent selector.
const
factory

Properties

hashCode → int
The hash code for this object.
no setteroverride
id → String
The identifier used for selection. Semantics depend on the concrete selector.
final
label → String
The human-readable label for this selector. May be empty.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
tag → String
The xml's element name (e.g., 'path', 'g', 'rect') this selector is intended to match.
final
type → InteractiveType
The interactivity type for this selector (view-only or touchable).
final

Methods

call(XmlNode element) → XmlNode?
Callable shorthand that delegates to selector.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
selector(XmlNode element) → XmlNode?
Returns true when element matches this selector.
toString() → String
A string representation of this object.
override

Operators

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