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, ); }