toJson method
Implementation
Map<String, dynamic> toJson({
Map<String, dynamic> Function(E data)? toJsonE,
}) {
return {
'id': id,
'node_id': nodeId,
'type': type.name,
'position': {'x': position.x, 'y': position.y},
'max_connections': connectionLimit,
if (data != null && toJsonE != null) 'data': toJsonE(data as E),
};
}