NodeInfo class
Represents information about a specific SVG node within an SVG.
The NodeInfo class holds the identifier of a node along with its element position and cursor position, as described by NodeCoordinate.
This class is used by the JujubaCommander to trigger commands in a specific SVG region or node.
Example:
final node = NodeInfo(
id: 'circle_1',
elementPosition: NodeCoordinate(x: 10, y: 20),
);
print(node.id); // circle_1
print(node.elementPosition.x); // 10
See also:
- NodeCoordinate, which defines the position of a node.
Constructors
- NodeInfo({required String id, required NodeCoordinate elementPosition, NodeCoordinate? cursorPosition})
-
Creates a new immutable NodeInfo with the given
id,elementPosition, and optionalcursorPosition.const - NodeInfo.fromJson(String json)
-
Creates a NodeInfo from a JSON string received from the JavaScript bridge.
factory
Properties
- cursorPosition → NodeCoordinate?
-
The cursor position at the moment of the click event, if available.
final
- elementPosition → NodeCoordinate
-
The element position information of the node.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → String
-
The unique identifier of the node.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
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