mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 15:17:31 +00:00
remove unused state functions
This commit is contained in:
@ -53,16 +53,6 @@ class SpaceManagementPageState extends State<SpaceManagementPage> {
|
|||||||
selectedCommunity: state.selectedCommunity,
|
selectedCommunity: state.selectedCommunity,
|
||||||
selectedSpace: state.selectedSpace,
|
selectedSpace: state.selectedSpace,
|
||||||
products: state.products,
|
products: state.products,
|
||||||
onCommunitySelected: (community) {
|
|
||||||
setState(() {
|
|
||||||
selectedCommunity = community;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
onSpaceSelected: (space) {
|
|
||||||
setState(() {
|
|
||||||
selectedSpace = space;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
);
|
);
|
||||||
} else if (state is SpaceManagementError) {
|
} else if (state is SpaceManagementError) {
|
||||||
return Center(child: Text('Error: ${state.errorMessage}'));
|
return Center(child: Text('Error: ${state.errorMessage}'));
|
||||||
|
@ -10,8 +10,6 @@ class LoadedSpaceView extends StatefulWidget {
|
|||||||
final List<CommunityModel> communities;
|
final List<CommunityModel> communities;
|
||||||
final CommunityModel? selectedCommunity;
|
final CommunityModel? selectedCommunity;
|
||||||
final SpaceModel? selectedSpace;
|
final SpaceModel? selectedSpace;
|
||||||
final ValueChanged<CommunityModel>? onCommunitySelected;
|
|
||||||
final ValueChanged<SpaceModel?>? onSpaceSelected;
|
|
||||||
final List<ProductModel>? products;
|
final List<ProductModel>? products;
|
||||||
|
|
||||||
const LoadedSpaceView({
|
const LoadedSpaceView({
|
||||||
@ -19,8 +17,6 @@ class LoadedSpaceView extends StatefulWidget {
|
|||||||
required this.communities,
|
required this.communities,
|
||||||
this.selectedCommunity,
|
this.selectedCommunity,
|
||||||
this.selectedSpace,
|
this.selectedSpace,
|
||||||
required this.onCommunitySelected,
|
|
||||||
required this.onSpaceSelected,
|
|
||||||
this.products,
|
this.products,
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -37,28 +33,14 @@ class _LoadedStateViewState extends State<LoadedSpaceView> {
|
|||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
SidebarWidget(
|
SidebarWidget(
|
||||||
communities: widget.communities,
|
communities: widget.communities,
|
||||||
onCommunitySelected: widget.onCommunitySelected,
|
selectedSpaceUuid: widget.selectedSpace?.uuid,
|
||||||
onSpaceSelected: widget.onSpaceSelected,
|
),
|
||||||
selectedSpaceUuid: widget.selectedSpace?.uuid,
|
|
||||||
onSelectedSpaceChanged: (String? spaceUuid) {
|
|
||||||
setState(() {
|
|
||||||
final selectedSpace = findSpaceByUuid(spaceUuid, widget.communities);
|
|
||||||
if (selectedSpace != null) {
|
|
||||||
widget.onSpaceSelected!(selectedSpace);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}),
|
|
||||||
CommunityStructureArea(
|
CommunityStructureArea(
|
||||||
selectedCommunity: widget.selectedCommunity,
|
selectedCommunity: widget.selectedCommunity,
|
||||||
selectedSpace: widget.selectedSpace,
|
selectedSpace: widget.selectedSpace,
|
||||||
spaces: widget.selectedCommunity?.spaces ?? [],
|
spaces: widget.selectedCommunity?.spaces ?? [],
|
||||||
products: widget.products,
|
products: widget.products,
|
||||||
onSpaceSelected: (SpaceModel? space) {
|
|
||||||
setState(() {
|
|
||||||
widget.onSpaceSelected!(space);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
Reference in New Issue
Block a user