diff --git a/lib/pages/spaces_management/widgets/community_structure_widget.dart b/lib/pages/spaces_management/widgets/community_structure_widget.dart index 9eca6913..f162b49f 100644 --- a/lib/pages/spaces_management/widgets/community_structure_widget.dart +++ b/lib/pages/spaces_management/widgets/community_structure_widget.dart @@ -209,11 +209,14 @@ class _CommunityStructureAreaState extends State { SpaceModel parentSpace = spaces[parentIndex]; newSpace.parent = parentSpace; parentSpace.children.add(newSpace); - connections.add(Connection( + final newConnection = Connection( startSpace: parentSpace, endSpace: newSpace, direction: direction, - )); + ); + connections.add(newConnection); + newSpace.addIncomingConnection(newConnection); + parentSpace.addOutgoingConnection(newConnection); } spaces.add(newSpace); @@ -239,5 +242,6 @@ class _CommunityStructureAreaState extends State { // Save to local storage, a file, or send to a backend print('Spaces: ${spaceData}'); print('Connections: ${connectionData}'); + } }