fixed community selection

This commit is contained in:
hannathkadher
2024-11-21 19:39:55 +04:00
parent 4a9d99d7b0
commit 6f554dc941
@@ -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);
} }
}, },