diff --git a/lib/pages/spaces_management/widgets/community_structure_widget.dart b/lib/pages/spaces_management/widgets/community_structure_widget.dart index 51b4a403..cdeccf32 100644 --- a/lib/pages/spaces_management/widgets/community_structure_widget.dart +++ b/lib/pages/spaces_management/widgets/community_structure_widget.dart @@ -24,14 +24,12 @@ class CommunityStructureArea extends StatefulWidget { final ValueChanged? onSpaceSelected; final List spaces; - final List connections; CommunityStructureArea({ this.selectedCommunity, this.selectedSpace, this.products, required this.spaces, - required this.connections, this.onSpaceSelected, }); @@ -76,7 +74,7 @@ class _CommunityStructureAreaState extends State { void didUpdateWidget(covariant CommunityStructureArea oldWidget) { super.didUpdateWidget(oldWidget); - if (oldWidget.spaces != widget.spaces || oldWidget.connections != widget.connections) { + if (oldWidget.spaces != widget.spaces) { setState(() { spaces = widget.spaces.isNotEmpty ? flattenSpaces(widget.spaces) : []; connections = widget.spaces.isNotEmpty ? createConnections(widget.spaces) : []; @@ -93,8 +91,7 @@ class _CommunityStructureAreaState extends State { @override Widget build(BuildContext context) { - final visibleSpaces = flattenSpaces(widget.spaces); - + final visibleSpaces = flattenSpaces(spaces); Size screenSize = MediaQuery.of(context).size; return Expanded( child: GestureDetector( @@ -277,7 +274,7 @@ class _CommunityStructureAreaState extends State { ], ), // Show "Save" button only if there are spaces - if (widget.spaces.isNotEmpty && widget.selectedCommunity != null) + if (spaces.isNotEmpty && widget.selectedCommunity != null) Row(children: [ ElevatedButton.icon( onPressed: () { diff --git a/lib/pages/spaces_management/widgets/loaded_space_widget.dart b/lib/pages/spaces_management/widgets/loaded_space_widget.dart index 509ddac1..3003b855 100644 --- a/lib/pages/spaces_management/widgets/loaded_space_widget.dart +++ b/lib/pages/spaces_management/widgets/loaded_space_widget.dart @@ -53,7 +53,6 @@ class _LoadedStateViewState extends State { selectedCommunity: widget.selectedCommunity, selectedSpace: widget.selectedSpace, spaces: widget.selectedCommunity?.spaces ?? [], - connections: const [], products: widget.products, onSpaceSelected: (SpaceModel? space) { setState(() {