pass selected space

This commit is contained in:
hannathkadher
2024-11-19 18:16:53 +04:00
parent a464788e88
commit 8a2efb2694
4 changed files with 29 additions and 8 deletions

View File

@ -20,6 +20,7 @@ class SpaceManagementPage extends StatefulWidget {
class SpaceManagementPageState extends State<SpaceManagementPage> {
CommunityModel? selectedCommunity;
SpaceModel? selectedSpace;
final CommunitySpaceManagementApi _api = CommunitySpaceManagementApi();
Map<String, List<SpaceModel>> communitySpaces = {};
double canvasWidth = 1000;
@ -55,11 +56,17 @@ class SpaceManagementPageState extends State<SpaceManagementPage> {
return LoadedSpaceView(
communities: state.communities,
selectedCommunity: selectedCommunity,
selectedSpace: selectedSpace,
onCommunitySelected: (community) {
setState(() {
selectedCommunity = community;
});
},
onSpaceSelected: (space) {
setState(() {
selectedSpace = space;
});
},
);
} else if (state is SpaceManagementError) {
return Center(child: Text('Error: ${state.errorMessage}'));