mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-09 22:57:21 +00:00
removed redundant code.
This commit is contained in:
@ -120,8 +120,6 @@ class _SidebarWidgetState extends State<SidebarWidget> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildCommunityTile(BuildContext context, CommunityModel community) {
|
Widget _buildCommunityTile(BuildContext context, CommunityModel community) {
|
||||||
final hasChildren = community.spaces.isNotEmpty;
|
|
||||||
|
|
||||||
return CommunityTile(
|
return CommunityTile(
|
||||||
title: community.name,
|
title: community.name,
|
||||||
key: ValueKey(community.uuid),
|
key: ValueKey(community.uuid),
|
||||||
@ -140,16 +138,14 @@ class _SidebarWidgetState extends State<SidebarWidget> {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
onExpansionChanged: (title, expanded) {},
|
onExpansionChanged: (title, expanded) {},
|
||||||
children: hasChildren
|
children: community.spaces
|
||||||
? community.spaces
|
.where((space) {
|
||||||
.where((space) {
|
final isDeleted = space.status != SpaceStatus.deleted;
|
||||||
final isDeleted = space.status != SpaceStatus.deleted;
|
final isParentDeleted = space.status != SpaceStatus.parentDeleted;
|
||||||
final isParentDeleted = space.status != SpaceStatus.parentDeleted;
|
return (isDeleted || isParentDeleted);
|
||||||
return (isDeleted || isParentDeleted);
|
})
|
||||||
})
|
.map((space) => _buildSpaceTile(space: space, community: community))
|
||||||
.map((space) => _buildSpaceTile(space: space, community: community))
|
.toList(),
|
||||||
.toList()
|
|
||||||
: null,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user