mirror of
https://github.com/SyncrowIOT/web.git
synced 2026-10-27 08:04:15 +00:00
fixed community selection
This commit is contained in:
@@ -179,8 +179,8 @@ class _SidebarWidgetState extends State<SidebarWidget> {
|
|||||||
// Check if this community is selected
|
// Check if this community is selected
|
||||||
return CommunityTile(
|
return CommunityTile(
|
||||||
title: community.name,
|
title: community.name,
|
||||||
key: ValueKey(community.uuid),
|
key: ValueKey(community.uuid),
|
||||||
isSelected: _selectedId == community.uuid,
|
isSelected: _selectedId == community.uuid,
|
||||||
isExpanded: false,
|
isExpanded: false,
|
||||||
onItemSelected: () {
|
onItemSelected: () {
|
||||||
setState(() {
|
setState(() {
|
||||||
@@ -208,7 +208,7 @@ class _SidebarWidgetState extends State<SidebarWidget> {
|
|||||||
// Check if space should be expanded
|
// Check if space should be expanded
|
||||||
return SpaceTile(
|
return SpaceTile(
|
||||||
title: space.name,
|
title: space.name,
|
||||||
key: ValueKey(space.uuid),
|
key: ValueKey(space.uuid),
|
||||||
isSelected: _selectedId == space.uuid,
|
isSelected: _selectedId == space.uuid,
|
||||||
initiallyExpanded: isExpandedSpace,
|
initiallyExpanded: isExpandedSpace,
|
||||||
onExpansionChanged: (bool expanded) {
|
onExpansionChanged: (bool expanded) {
|
||||||
@@ -221,6 +221,7 @@ class _SidebarWidgetState extends State<SidebarWidget> {
|
|||||||
_selectedCommunityUuid = community.uuid; // Update selected community
|
_selectedCommunityUuid = community.uuid; // Update selected community
|
||||||
});
|
});
|
||||||
if (widget.onSpaceSelected != null) {
|
if (widget.onSpaceSelected != null) {
|
||||||
|
widget.onCommunitySelected!(community);
|
||||||
widget.onSpaceSelected!(space);
|
widget.onSpaceSelected!(space);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user