From 065bd33511bccb7e856af928450938546339ca5b Mon Sep 17 00:00:00 2001 From: Faris Armoush Date: Mon, 21 Apr 2025 10:03:02 +0300 Subject: [PATCH] SP-1330. --- .../all_spaces/widgets/sidebar_widget.dart | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/lib/pages/spaces_management/all_spaces/widgets/sidebar_widget.dart b/lib/pages/spaces_management/all_spaces/widgets/sidebar_widget.dart index 198ebc51..6dc8ae9c 100644 --- a/lib/pages/spaces_management/all_spaces/widgets/sidebar_widget.dart +++ b/lib/pages/spaces_management/all_spaces/widgets/sidebar_widget.dart @@ -136,6 +136,17 @@ class _SidebarWidgetState extends State { } Widget _buildCommunityTile(BuildContext context, CommunityModel community) { + final spaces = community.spaces + .where( + (space) => + { + SpaceStatus.deleted, + SpaceStatus.parentDeleted, + }.contains(space.status) == + false, + ) + .map((space) => _buildSpaceTile(space: space, community: community)) + .toList(); return CommunityTile( title: community.name, key: ValueKey(community.uuid), @@ -154,15 +165,7 @@ class _SidebarWidgetState extends State { ); }, onExpansionChanged: (title, expanded) {}, - children: community.spaces - .where( - (space) => { - SpaceStatus.deleted, - SpaceStatus.parentDeleted, - }.contains(space.status), - ) - .map((space) => _buildSpaceTile(space: space, community: community)) - .toList(), + children: spaces, ); }