fixed expand error

This commit is contained in:
hannathkadher
2024-10-08 20:03:31 +04:00
parent 72dfedf2b6
commit 1156af9b8e
6 changed files with 60 additions and 52 deletions

View File

@ -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(),