added on select for community

This commit is contained in:
hannathkadher
2024-10-09 10:42:35 +04:00
parent 1046690f9b
commit ec4bb9bc04
3 changed files with 27 additions and 10 deletions

View File

@ -30,6 +30,9 @@ class SpaceManagementPageState extends State<SpaceManagementPage> {
// Track whether to show the community list view or community structure
bool showCommunityStructure = false;
// Selected community
CommunityModel? selectedCommunity;
// API instance
final CommunitySpaceManagementApi _api = CommunitySpaceManagementApi();
@ -80,20 +83,23 @@ class SpaceManagementPageState extends State<SpaceManagementPage> {
SidebarWidget(
communities: communities,
onCommunitySelected: (community) {
context.read<SpaceManagementBloc>().add(
LoadCommunityAndSpacesEvent(), // Re-fetch or perform community-specific actions
);
},
),
const SizedBox(width: 45),
showCommunityStructure
? _buildCommunityStructureArea(context, screenSize)
: CommunityListViewWidget(
communities: communities,
onCommunitySelected: (community) {
setState(() {
selectedCommunity = community;
showCommunityStructure = true;
});
},
),
],
),
const GradientBorderWidget()
const GradientCanvasBorderWidget()
],
);
}