blank community should also take to community structure

This commit is contained in:
hannathkadher
2024-10-09 10:58:37 +04:00
parent 7122ad5ac1
commit 4e7aba3983

View File

@ -3,7 +3,7 @@ import 'package:syncrow_web/pages/spaces_management/model/community_model.dart';
class CommunityListViewWidget extends StatelessWidget { class CommunityListViewWidget extends StatelessWidget {
final List<CommunityModel> communities; final List<CommunityModel> communities;
final Function(CommunityModel) onCommunitySelected; final Function(CommunityModel?) onCommunitySelected;
const CommunityListViewWidget({ const CommunityListViewWidget({
Key? key, Key? key,
@ -32,7 +32,11 @@ class CommunityListViewWidget extends StatelessWidget {
itemBuilder: (context, index) { itemBuilder: (context, index) {
// If the index is 0, display the blank community, otherwise display the normal ones // If the index is 0, display the blank community, otherwise display the normal ones
if (index == 0) { if (index == 0) {
return _buildBlankCommunityCard(size); return GestureDetector(
onTap: () =>
onCommunitySelected(null), // Pass null for blank community
child: _buildBlankCommunityCard(size),
);
} else { } else {
return GestureDetector( return GestureDetector(
onTap: () => onCommunitySelected( onTap: () => onCommunitySelected(
@ -71,7 +75,7 @@ class CommunityListViewWidget extends StatelessWidget {
height: height:
size.height * 0.02), // Add spacing between container and text size.height * 0.02), // Add spacing between container and text
// Text saying "Blank" for the blank community // Text saying "Blank" for the blank community
Text( const Text(
'Blank', 'Blank',
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(