mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-09 22:57:21 +00:00
SP-1189-FE-Add-Button-Not-clickable-Opening-Pop-up-in-Community-Screen
This commit is contained in:
@ -1,32 +1,51 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:syncrow_web/pages/spaces_management/all_spaces/bloc/space_management_bloc.dart';
|
||||
import 'package:syncrow_web/pages/spaces_management/all_spaces/bloc/space_management_event.dart';
|
||||
import 'package:syncrow_web/pages/spaces_management/create_community/view/create_community_dialog.dart';
|
||||
import 'package:syncrow_web/utils/color_manager.dart';
|
||||
import 'package:syncrow_web/utils/constants/assets.dart';
|
||||
|
||||
class SidebarAddCommunityButton extends StatelessWidget {
|
||||
const SidebarAddCommunityButton({super.key});
|
||||
const SidebarAddCommunityButton({
|
||||
required this.existingCommunityNames,
|
||||
super.key,
|
||||
});
|
||||
|
||||
final List<String> existingCommunityNames;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GestureDetector(
|
||||
onTap: () => _navigateToBlank(context),
|
||||
child: Container(
|
||||
width: 30,
|
||||
height: 30,
|
||||
decoration: const BoxDecoration(
|
||||
color: ColorsManager.whiteColors,
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: Center(
|
||||
child: SvgPicture.asset(
|
||||
Assets.roundedAddIcon,
|
||||
width: 24,
|
||||
height: 24,
|
||||
return SizedBox.square(
|
||||
dimension: 30,
|
||||
child: IconButton(
|
||||
style: IconButton.styleFrom(
|
||||
iconSize: 20,
|
||||
backgroundColor: ColorsManager.circleImageBackground,
|
||||
shape: const CircleBorder(
|
||||
side: BorderSide(
|
||||
color: ColorsManager.lightGrayBorderColor,
|
||||
width: 3,
|
||||
),
|
||||
),
|
||||
),
|
||||
onPressed: () => _showCreateCommunityDialog(context),
|
||||
icon: SvgPicture.asset(Assets.addIcon),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void _navigateToBlank(BuildContext context) {}
|
||||
void _showCreateCommunityDialog(BuildContext context) => showDialog<void>(
|
||||
context: context,
|
||||
builder: (context) => CreateCommunityDialog(
|
||||
isEditMode: false,
|
||||
existingCommunityNames: existingCommunityNames,
|
||||
onCreateCommunity: (name, description) {
|
||||
context.read<SpaceManagementBloc>().add(
|
||||
CreateCommunityEvent(name, description, context),
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@ -5,13 +5,15 @@ import 'package:syncrow_web/utils/extension/build_context_x.dart';
|
||||
import 'package:syncrow_web/utils/style.dart';
|
||||
|
||||
class SidebarHeader extends StatelessWidget {
|
||||
const SidebarHeader({super.key});
|
||||
const SidebarHeader({required this.existingCommunityNames, super.key});
|
||||
|
||||
final List<String> existingCommunityNames;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
decoration: subSectionContainerDecoration,
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
@ -21,7 +23,7 @@ class SidebarHeader extends StatelessWidget {
|
||||
color: ColorsManager.blackColor,
|
||||
),
|
||||
),
|
||||
const SidebarAddCommunityButton(),
|
||||
SidebarAddCommunityButton(existingCommunityNames: existingCommunityNames),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
@ -94,7 +94,10 @@ class _SidebarWidgetState extends State<SidebarWidget> {
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const SidebarHeader(),
|
||||
SidebarHeader(
|
||||
existingCommunityNames:
|
||||
widget.communities.map((community) => community.name).toList(),
|
||||
),
|
||||
CustomSearchBar(
|
||||
onSearchChanged: (query) => setState(() => _searchQuery = query),
|
||||
),
|
||||
|
Reference in New Issue
Block a user