mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-16 01:56:24 +00:00
fixed delete community
This commit is contained in:
@ -119,7 +119,6 @@ class _CommunityStructureAreaState extends State<CommunityStructureArea> {
|
||||
return SpaceContainerWidget(
|
||||
index: index,
|
||||
onDoubleTap: () {
|
||||
print(spaces[index].toString());
|
||||
_showEditSpaceDialog(spaces[index]);
|
||||
},
|
||||
icon: spaces[index].icon ?? '',
|
||||
@ -209,12 +208,12 @@ class _CommunityStructureAreaState extends State<CommunityStructureArea> {
|
||||
onPressed: () {
|
||||
showDeleteConfirmationDialog(context, () {
|
||||
// Handle the delete action here
|
||||
print("Delete confirmed");
|
||||
Navigator.of(context).pop(); // Close the dialog after confirming
|
||||
_onDelete();
|
||||
}, widget.selectedSpace != null);
|
||||
},
|
||||
icon: SvgPicture.asset(
|
||||
Assets.acFanAuto, // Path to your SVG asset
|
||||
Assets.delete, // Path to your SVG asset
|
||||
width: 18, // Adjust width as needed
|
||||
height: 18, // Adjust height as needed
|
||||
),
|
||||
@ -426,4 +425,13 @@ class _CommunityStructureAreaState extends State<CommunityStructureArea> {
|
||||
communityUuid: communityUuid,
|
||||
));
|
||||
}
|
||||
|
||||
void _onDelete() {
|
||||
if (widget.selectedCommunity != null && widget.selectedCommunity?.uuid != null) {
|
||||
context.read<SpaceManagementBloc>().add(DeleteCommunityEvent(
|
||||
communityUuid: widget.selectedCommunity!.uuid,
|
||||
));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user