SP-1189-Fix tapping ok and nothing happening bug by taking the action out of the widget.

This commit is contained in:
Faris Armoush
2025-04-15 14:38:06 +03:00
parent 7dcaa20da1
commit 1bfab8cc76
7 changed files with 297 additions and 192 deletions

View File

@ -16,9 +16,11 @@ import 'package:syncrow_web/utils/style.dart';
class SidebarWidget extends StatefulWidget {
final List<CommunityModel> communities;
final String? selectedSpaceUuid;
final void Function(String name, String description) onCreateCommunity;
const SidebarWidget({
required this.communities,
required this.onCreateCommunity,
this.selectedSpaceUuid,
super.key,
});
@ -195,11 +197,7 @@ class _SidebarWidgetState extends State<SidebarWidget> {
builder: (context) => CreateCommunityDialog(
isEditMode: false,
existingCommunityNames: widget.communities.map((e) => e.name).toList(),
onCreateCommunity: (name, description) {
context.read<SpaceManagementBloc>().add(
CreateCommunityEvent(name, description, context),
);
},
onCreateCommunity: widget.onCreateCommunity,
),
);
}