mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 15:17:31 +00:00
appear save only if spaces is empty or any new,deleted,updated space
This commit is contained in:
@ -12,7 +12,7 @@ import 'package:syncrow_web/pages/spaces_management/model/space_model.dart';
|
||||
import 'package:syncrow_web/pages/spaces_management/model/community_model.dart';
|
||||
import 'package:syncrow_web/pages/spaces_management/model/connection_model.dart';
|
||||
import 'package:syncrow_web/pages/spaces_management/widgets/blank_community_widget.dart';
|
||||
import 'package:syncrow_web/pages/spaces_management/widgets/community_stricture_header_widget.dart';
|
||||
import 'package:syncrow_web/pages/spaces_management/widgets/community_structure_header_widget.dart';
|
||||
import 'package:syncrow_web/pages/spaces_management/widgets/dialogs/create_space_dialog.dart';
|
||||
import 'package:syncrow_web/pages/spaces_management/widgets/curved_line_painter.dart';
|
||||
import 'package:syncrow_web/pages/spaces_management/widgets/space_card_widget.dart';
|
||||
@ -114,7 +114,7 @@ class _CommunityStructureAreaState extends State<CommunityStructureArea> {
|
||||
children: [
|
||||
CommunityStructureHeader(
|
||||
communityName: widget.selectedCommunity?.name,
|
||||
isSave: spaces.isNotEmpty,
|
||||
isSave: isSave(spaces),
|
||||
isEditingName: isEditingName,
|
||||
nameController: _nameController,
|
||||
onSave: _saveSpaces,
|
||||
@ -510,4 +510,12 @@ class _CommunityStructureAreaState extends State<CommunityStructureArea> {
|
||||
screenSize.height / 2 - 200,
|
||||
);
|
||||
}
|
||||
|
||||
bool isSave(List<SpaceModel> spaces) {
|
||||
return spaces.isNotEmpty &&
|
||||
spaces.any((space) =>
|
||||
space.status == SpaceStatus.newSpace ||
|
||||
space.status == SpaceStatus.modified ||
|
||||
space.status == SpaceStatus.deleted);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user