Node class

The Node class represents a node in a graphical system with input and output ports, allowing for serialization and deserialization to JSON.

Constructors

Node({required Offset position, required NodeData data, required int id, Size size = const Size(150, 80), List<Port>? inputs, List<Port>? outputs})
Node.fromJson(Map<String, dynamic> json)
The function Node.fromJson parses a JSON map to create a Node object with specified properties.
factory

Properties

data NodeData
final
hashCode int
The hash code for this object.
no setterinherited
id int
final
inputPorts List<Port>
final
outputPorts List<Port>
final
position Offset
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
size Size
getter/setter pair

Methods

getPortCenterAbsolute(int index, bool isOutput) Offset
The function getPortCenterAbsolute calculates the absolute center position of a port based on its index and whether it is an output port or not.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setSize(Size newSize) → void
The function setSize sets a new size and calculates port positions accordingly.
toJson() Map<String, dynamic>
This function converts an object's properties into a JSON format.
toString() String
A string representation of this object.
inherited

Operators

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