From 0c5db9dfeb1f63889b3968db1a7445a979e5a948 Mon Sep 17 00:00:00 2001 From: raf-dev1 Date: Wed, 11 Jun 2025 16:35:19 +0300 Subject: [PATCH 1/2] add bool function to space model if no changes made on object --- .../spaces_management/all_spaces/model/space_model.dart | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/pages/spaces_management/all_spaces/model/space_model.dart b/lib/pages/spaces_management/all_spaces/model/space_model.dart index 4956d472..f9c59d24 100644 --- a/lib/pages/spaces_management/all_spaces/model/space_model.dart +++ b/lib/pages/spaces_management/all_spaces/model/space_model.dart @@ -171,4 +171,13 @@ extension SpaceExtensions on SpaceModel { return tagValues; } + + bool isNoChangesSubmited(String name, icon, SpaceTemplateModel? spaceModel, + List? subspaces, List? tags) { + return (name == this.name && + icon == this.icon && + spaceModel == this.spaceModel && + subspaces == this.subspaces && + tags == this.tags); + } } From 27dbcb26f1c2070bb45cc2931c26502fe6006db0 Mon Sep 17 00:00:00 2001 From: raf-dev1 Date: Wed, 11 Jun 2025 16:35:34 +0300 Subject: [PATCH 2/2] use function to fix bug --- .../all_spaces/widgets/community_structure_widget.dart | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/pages/spaces_management/all_spaces/widgets/community_structure_widget.dart b/lib/pages/spaces_management/all_spaces/widgets/community_structure_widget.dart index 178f7659..4f68fb7e 100644 --- a/lib/pages/spaces_management/all_spaces/widgets/community_structure_widget.dart +++ b/lib/pages/spaces_management/all_spaces/widgets/community_structure_widget.dart @@ -384,6 +384,15 @@ class _CommunityStructureAreaState extends State { SpaceTemplateModel? spaceModel, List? subspaces, List? tags) { + if (widget.selectedSpace!.isNoChangesSubmited( + name, + icon, + spaceModel, + subspaces, + tags, + )) { + return; + } setState(() { // Update the space's properties widget.selectedSpace!.name = name;