Removed community view

This commit is contained in:
hannathkadher
2024-10-11 10:46:30 +04:00
parent 29a1470428
commit cd957ed1c7
4 changed files with 12 additions and 149 deletions

View File

@ -1,6 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:syncrow_web/pages/common/buttons/cancel_button.dart';
import 'package:syncrow_web/pages/common/buttons/default_button.dart';
import 'package:syncrow_web/pages/device_managment/all_devices/models/device_type_model.dart';
import 'package:syncrow_web/pages/spaces_management/widgets/counter_widget.dart';

View File

@ -14,10 +14,11 @@ import 'package:syncrow_web/utils/constants/assets.dart';
import 'package:syncrow_web/utils/style.dart';
class SidebarWidget extends StatefulWidget {
final Function(String)? onCommunitySelected;
final Function(CommunityModel)? onCommunitySelected;
final List<CommunityModel> communities;
const SidebarWidget({super.key, this.onCommunitySelected, required this.communities});
const SidebarWidget(
{super.key, this.onCommunitySelected, required this.communities});
@override
_SidebarWidgetState createState() => _SidebarWidgetState();
@ -185,6 +186,9 @@ class _SidebarWidgetState extends State<SidebarWidget> {
debugPrint(
'CommunityTile onExpansionChanged called for $title, expanded: $expanded');
_handleExpansionChange(community.uuid, expanded);
if (widget.onCommunitySelected != null) {
widget.onCommunitySelected!(community); // Pass the entire community
}
},
children: hasChildren
? community.spaces.map((space) => _buildSpaceTile(space)).toList()