diff --git a/lib/pages/spaces_management/view/spaces_management_page.dart b/lib/pages/spaces_management/view/spaces_management_page.dart index 0496c179..5b00d63f 100644 --- a/lib/pages/spaces_management/view/spaces_management_page.dart +++ b/lib/pages/spaces_management/view/spaces_management_page.dart @@ -53,16 +53,6 @@ class SpaceManagementPageState extends State { selectedCommunity: state.selectedCommunity, selectedSpace: state.selectedSpace, products: state.products, - onCommunitySelected: (community) { - setState(() { - selectedCommunity = community; - }); - }, - onSpaceSelected: (space) { - setState(() { - selectedSpace = space; - }); - }, ); } else if (state is SpaceManagementError) { return Center(child: Text('Error: ${state.errorMessage}')); diff --git a/lib/pages/spaces_management/widgets/loaded_space_widget.dart b/lib/pages/spaces_management/widgets/loaded_space_widget.dart index aa48d323..5b340398 100644 --- a/lib/pages/spaces_management/widgets/loaded_space_widget.dart +++ b/lib/pages/spaces_management/widgets/loaded_space_widget.dart @@ -10,8 +10,6 @@ class LoadedSpaceView extends StatefulWidget { final List communities; final CommunityModel? selectedCommunity; final SpaceModel? selectedSpace; - final ValueChanged? onCommunitySelected; - final ValueChanged? onSpaceSelected; final List? products; const LoadedSpaceView({ @@ -19,8 +17,6 @@ class LoadedSpaceView extends StatefulWidget { required this.communities, this.selectedCommunity, this.selectedSpace, - required this.onCommunitySelected, - required this.onSpaceSelected, this.products, }); @@ -37,28 +33,14 @@ class _LoadedStateViewState extends State { Row( children: [ SidebarWidget( - communities: widget.communities, - onCommunitySelected: widget.onCommunitySelected, - onSpaceSelected: widget.onSpaceSelected, - selectedSpaceUuid: widget.selectedSpace?.uuid, - onSelectedSpaceChanged: (String? spaceUuid) { - setState(() { - final selectedSpace = findSpaceByUuid(spaceUuid, widget.communities); - if (selectedSpace != null) { - widget.onSpaceSelected!(selectedSpace); - } - }); - }), + communities: widget.communities, + selectedSpaceUuid: widget.selectedSpace?.uuid, + ), CommunityStructureArea( selectedCommunity: widget.selectedCommunity, selectedSpace: widget.selectedSpace, spaces: widget.selectedCommunity?.spaces ?? [], products: widget.products, - onSpaceSelected: (SpaceModel? space) { - setState(() { - widget.onSpaceSelected!(space); - }); - }, ), ], ),