mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-15 09:45:25 +00:00
added internal id for mapping spaces internally
This commit is contained in:
@ -286,6 +286,7 @@ class _CommunityStructureAreaState extends State<CommunityStructureArea> {
|
||||
|
||||
if (parentIndex != null && direction != null) {
|
||||
SpaceModel parentSpace = spaces[parentIndex];
|
||||
parentSpace.internalId = spaces[parentIndex].internalId;
|
||||
newSpace.parent = parentSpace;
|
||||
final newConnection = Connection(
|
||||
startSpace: parentSpace,
|
||||
@ -371,13 +372,11 @@ class _CommunityStructureAreaState extends State<CommunityStructureArea> {
|
||||
for (var child in parent.children) {
|
||||
if (child.status == SpaceStatus.deleted) continue;
|
||||
|
||||
// Create a connection object
|
||||
connections.add(
|
||||
Connection(
|
||||
startSpace: parent,
|
||||
endSpace: child,
|
||||
direction: child.incomingConnection?.direction ??
|
||||
"down", // Assuming "down" for all direct children
|
||||
direction: child.incomingConnection?.direction ?? "down",
|
||||
),
|
||||
);
|
||||
|
||||
@ -478,11 +477,15 @@ class _CommunityStructureAreaState extends State<CommunityStructureArea> {
|
||||
bool _isHighlightedSpace(SpaceModel space) {
|
||||
if (widget.selectedSpace == null) return true;
|
||||
if (space == widget.selectedSpace) return true;
|
||||
if (widget.selectedSpace?.parent?.name == space.name &&
|
||||
widget.selectedSpace?.parent?.position == space.position) return true;
|
||||
if (widget.selectedSpace?.children.contains(space) == true) return true;
|
||||
|
||||
return false; // Otherwise, reduce opacity
|
||||
if (widget.selectedSpace?.parent?.internalId == space.internalId) return true;
|
||||
if (widget.selectedSpace?.children != null) {
|
||||
for (var child in widget.selectedSpace!.children) {
|
||||
if (child.internalId == space.internalId) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void _deselectSpace() {
|
||||
|
Reference in New Issue
Block a user