add ongoing and incoming connections

This commit is contained in:
hannathkadher
2024-11-18 20:44:42 +04:00
parent d0b74ca68a
commit 7241f78566

View File

@ -209,11 +209,14 @@ class _CommunityStructureAreaState extends State<CommunityStructureArea> {
SpaceModel parentSpace = spaces[parentIndex]; SpaceModel parentSpace = spaces[parentIndex];
newSpace.parent = parentSpace; newSpace.parent = parentSpace;
parentSpace.children.add(newSpace); parentSpace.children.add(newSpace);
connections.add(Connection( final newConnection = Connection(
startSpace: parentSpace, startSpace: parentSpace,
endSpace: newSpace, endSpace: newSpace,
direction: direction, direction: direction,
)); );
connections.add(newConnection);
newSpace.addIncomingConnection(newConnection);
parentSpace.addOutgoingConnection(newConnection);
} }
spaces.add(newSpace); spaces.add(newSpace);
@ -239,5 +242,6 @@ class _CommunityStructureAreaState extends State<CommunityStructureArea> {
// Save to local storage, a file, or send to a backend // Save to local storage, a file, or send to a backend
print('Spaces: ${spaceData}'); print('Spaces: ${spaceData}');
print('Connections: ${connectionData}'); print('Connections: ${connectionData}');
} }
} }