mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 15:17:31 +00:00
add ongoing and incoming connections
This commit is contained in:
@ -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}');
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user