mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-11-27 21:34:55 +00:00
fixed expand error
This commit is contained in:
@ -4,6 +4,7 @@ import 'package:syncrow_web/pages/common/buttons/add_space_button.dart';
|
||||
import 'package:syncrow_web/pages/spaces_management/bloc/space_management_bloc.dart';
|
||||
import 'package:syncrow_web/pages/spaces_management/bloc/space_management_event.dart';
|
||||
import 'package:syncrow_web/pages/spaces_management/bloc/space_management_state.dart';
|
||||
import 'package:syncrow_web/pages/spaces_management/model/community_model.dart';
|
||||
import 'package:syncrow_web/pages/spaces_management/model/space_model.dart';
|
||||
import 'package:syncrow_web/pages/spaces_management/view/curved_line_painter.dart';
|
||||
import 'package:syncrow_web/pages/spaces_management/view/dialogs/create_space_dialog.dart';
|
||||
@ -53,8 +54,7 @@ class SpaceManagementPageState extends State<SpaceManagementPage> {
|
||||
if (state is SpaceManagementLoading) {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
} else if (state is SpaceManagementLoaded) {
|
||||
return _buildLoadedState(
|
||||
context, screenSize, state.communitySpaces);
|
||||
return _buildLoadedState(context, screenSize, state.communities);
|
||||
} else if (state is SpaceManagementError) {
|
||||
return Center(child: Text('Error: ${state.errorMessage}'));
|
||||
}
|
||||
@ -65,24 +65,22 @@ class SpaceManagementPageState extends State<SpaceManagementPage> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildLoadedState(BuildContext context, Size screenSize,
|
||||
Map<String, List<SpaceModel>> communitySpaces) {
|
||||
Widget _buildLoadedState(
|
||||
BuildContext context, Size screenSize, List<CommunityModel> communities) {
|
||||
return Stack(
|
||||
clipBehavior: Clip.none,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
SidebarWidget(
|
||||
communitySpaces: communitySpaces,
|
||||
communities: communities,
|
||||
onCommunitySelected: (community) {
|
||||
context.read<SpaceManagementBloc>().add(
|
||||
LoadCommunityAndSpacesEvent(), // Re-fetch or perform community-specific actions
|
||||
);
|
||||
},
|
||||
),
|
||||
Expanded(
|
||||
child: _buildCommunityStructureArea(context, screenSize),
|
||||
),
|
||||
_buildCommunityStructureArea(context, screenSize),
|
||||
],
|
||||
),
|
||||
_buildGradientBorder(),
|
||||
|
||||
Reference in New Issue
Block a user