diff --git a/lib/pages/spaces_management/all_spaces/bloc/space_management_bloc.dart b/lib/pages/spaces_management/all_spaces/bloc/space_management_bloc.dart index 31e19af4..a525334d 100644 --- a/lib/pages/spaces_management/all_spaces/bloc/space_management_bloc.dart +++ b/lib/pages/spaces_management/all_spaces/bloc/space_management_bloc.dart @@ -87,6 +87,7 @@ class SpaceManagementBloc prevSpaceModels = List.from( (previousState as dynamic).spaceModels ?? [], ); + allSpaces.addAll(prevSpaceModels); } if (prevSpaceModels.isEmpty) { @@ -273,6 +274,8 @@ class SpaceManagementBloc await _api.createCommunity(event.name, event.description); var prevSpaceModels = await fetchSpaceModels(previousState); + print("space models are ${prevSpaceModels}"); + if (newCommunity != null) { if (previousState is SpaceManagementLoaded || previousState is BlankState) { @@ -314,7 +317,6 @@ class SpaceManagementBloc SelectSpaceEvent event, Emitter emit, ) { - _handleCommunitySpaceStateUpdate( emit: emit, selectedCommunity: event.selectedCommunity, diff --git a/lib/pages/spaces_management/all_spaces/view/spaces_management_page.dart b/lib/pages/spaces_management/all_spaces/view/spaces_management_page.dart index e601cca4..94e153f1 100644 --- a/lib/pages/spaces_management/all_spaces/view/spaces_management_page.dart +++ b/lib/pages/spaces_management/all_spaces/view/spaces_management_page.dart @@ -43,6 +43,7 @@ class SpaceManagementPageState extends State { rightBody: const NavigateHomeGridView(), scaffoldBody: BlocBuilder( builder: (context, state) { + print("current state is ${state}"); if (state is SpaceManagementLoading) { return const Center(child: CircularProgressIndicator()); } else if (state is BlankState) { diff --git a/lib/pages/spaces_management/all_spaces/widgets/dialogs/create_space_dialog.dart b/lib/pages/spaces_management/all_spaces/widgets/dialogs/create_space_dialog.dart index 4e0bc317..a3e19fce 100644 --- a/lib/pages/spaces_management/all_spaces/widgets/dialogs/create_space_dialog.dart +++ b/lib/pages/spaces_management/all_spaces/widgets/dialogs/create_space_dialog.dart @@ -83,8 +83,13 @@ class CreateSpaceDialogState extends State { widget.selectedProducts.isNotEmpty ? widget.selectedProducts : []; isOkButtonEnabled = enteredName.isNotEmpty || nameController.text.isNotEmpty; - tags = widget.tags ?? []; - subspaces = widget.subspaces ?? []; + if (widget.currentSpaceModel != null) { + subspaces = []; + tags = []; + } else { + tags = widget.tags ?? []; + subspaces = widget.subspaces ?? []; + } selectedSpaceModel = widget.currentSpaceModel; } @@ -661,8 +666,7 @@ class CreateSpaceDialogState extends State { void _showTagCreateDialog(BuildContext context, String name, bool isEdit, List? products) { - - print("ada ${widget.allTags}"); + print("ada ${widget.allTags}"); isEdit ? showDialog( context: context,