remoived debug print

This commit is contained in:
hannathkadher
2024-10-14 10:07:29 +04:00
parent 220cfdbd27
commit df3b3131be
3 changed files with 3 additions and 21 deletions

View File

@ -32,10 +32,6 @@ class SpaceManagementBloc
communities.map((community) async { communities.map((community) async {
List<SpaceModel> spaces = List<SpaceModel> spaces =
await _api.getSpaceHierarchy(community.uuid); await _api.getSpaceHierarchy(community.uuid);
debugPrint(
'Fetched spaces for community ${community.name}: ${spaces.length}');
return CommunityModel( return CommunityModel(
uuid: community.uuid, uuid: community.uuid,
createdAt: community.createdAt, createdAt: community.createdAt,

View File

@ -56,6 +56,7 @@ class SpaceManagementPageState extends State<SpaceManagementPage> {
maxX = max(maxX, space.position.dx + 150); // Width of space maxX = max(maxX, space.position.dx + 150); // Width of space
maxY = max(maxY, space.position.dy + 60); // Height of space maxY = max(maxY, space.position.dy + 60); // Height of space
} }
print("Max X: $maxX, Max Y: $maxY");
setState(() { setState(() {
canvasWidth = max(canvasWidth, maxX + 200); // Ensure padding canvasWidth = max(canvasWidth, maxX + 200); // Ensure padding
@ -210,7 +211,6 @@ class SpaceManagementPageState extends State<SpaceManagementPage> {
setState(() { setState(() {
spaces[index].position += delta; spaces[index].position += delta;
}); });
updateCanvasSize();
}, },
onHoverChanged: onHoverChanged:
(int index, bool isHovered) { (int index, bool isHovered) {
@ -255,6 +255,8 @@ class SpaceManagementPageState extends State<SpaceManagementPage> {
builder: (BuildContext context) { builder: (BuildContext context) {
return CreateSpaceDialog( return CreateSpaceDialog(
onCreateSpace: (String name, String icon) { onCreateSpace: (String name, String icon) {
updateCanvasSize();
setState(() { setState(() {
// Set the first space in the center or use passed position // Set the first space in the center or use passed position
Offset centerPosition = position ?? Offset centerPosition = position ??

View File

@ -177,11 +177,6 @@ class _SidebarWidgetState extends State<SidebarWidget> {
bool hasChildren = community.spaces.isNotEmpty; bool hasChildren = community.spaces.isNotEmpty;
bool isSelectedCommunity = _selectedCommunityUuid == bool isSelectedCommunity = _selectedCommunityUuid ==
community.uuid; // Check if this community is selected community.uuid; // Check if this community is selected
debugPrint('Building CommunityTile for ${community.name} with UUID: ${community.uuid}');
debugPrint('Currently selected community UUID: $_selectedCommunityUuid');
debugPrint('Is selected: $isSelectedCommunity');
return CommunityTile( return CommunityTile(
title: community.name, title: community.name,
isSelected: isSelectedCommunity, isSelected: isSelectedCommunity,
@ -189,10 +184,6 @@ class _SidebarWidgetState extends State<SidebarWidget> {
onItemSelected: () { onItemSelected: () {
setState(() { setState(() {
_selectedSpaceUuid = community.uuid; // Update the selected community _selectedSpaceUuid = community.uuid; // Update the selected community
debugPrint(
'Selected community: ${community.name}, UUID: ${community.uuid}');
debugPrint(
'Updated selected community UUID: $_selectedCommunityUuid');
}); });
if (widget.onCommunitySelected != null) { if (widget.onCommunitySelected != null) {
@ -200,8 +191,6 @@ class _SidebarWidgetState extends State<SidebarWidget> {
} }
}, },
onExpansionChanged: (String title, bool expanded) { onExpansionChanged: (String title, bool expanded) {
debugPrint(
'CommunityTile onExpansionChanged called for $title, expanded: $expanded');
_handleExpansionChange(community.uuid, expanded); _handleExpansionChange(community.uuid, expanded);
}, },
children: hasChildren children: hasChildren
@ -213,15 +202,10 @@ class _SidebarWidgetState extends State<SidebarWidget> {
Widget _buildSpaceTile(SpaceModel space) { Widget _buildSpaceTile(SpaceModel space) {
bool isSelectedSpace = bool isSelectedSpace =
_isSpaceOrChildSelected(space); // Check if space should be expanded _isSpaceOrChildSelected(space); // Check if space should be expanded
debugPrint(
'Building SpaceTile for ${space.name}, hasChildren: ${space.children.isNotEmpty}');
return SpaceTile( return SpaceTile(
title: space.name, title: space.name,
initiallyExpanded: isSelectedSpace, initiallyExpanded: isSelectedSpace,
onExpansionChanged: (bool expanded) { onExpansionChanged: (bool expanded) {
debugPrint(
'SpaceTile onExpansionChanged called for ${space.name}, expanded: $expanded');
_handleExpansionChange(space.uuid, expanded); _handleExpansionChange(space.uuid, expanded);
}, },
children: space.children.isNotEmpty children: space.children.isNotEmpty