updated highlighted space

This commit is contained in:
hannathkadher
2024-11-28 20:02:41 +04:00
parent 817671dbeb
commit 084f4fbda8

View File

@ -485,18 +485,14 @@ 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?.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;
final selectedSpace = widget.selectedSpace;
if (selectedSpace == null) return true;
return space == selectedSpace ||
selectedSpace.parent?.internalId == space.internalId ||
selectedSpace.children
?.any((child) => child.internalId == space.internalId) ==
true;
}
void _deselectSpace(BuildContext context) {