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 {
List<SpaceModel> spaces =
await _api.getSpaceHierarchy(community.uuid);
debugPrint(
'Fetched spaces for community ${community.name}: ${spaces.length}');
return CommunityModel(
uuid: community.uuid,
createdAt: community.createdAt,

View File

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

View File

@ -177,11 +177,6 @@ class _SidebarWidgetState extends State<SidebarWidget> {
bool hasChildren = community.spaces.isNotEmpty;
bool isSelectedCommunity = _selectedCommunityUuid ==
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(
title: community.name,
isSelected: isSelectedCommunity,
@ -189,10 +184,6 @@ class _SidebarWidgetState extends State<SidebarWidget> {
onItemSelected: () {
setState(() {
_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) {
@ -200,8 +191,6 @@ class _SidebarWidgetState extends State<SidebarWidget> {
}
},
onExpansionChanged: (String title, bool expanded) {
debugPrint(
'CommunityTile onExpansionChanged called for $title, expanded: $expanded');
_handleExpansionChange(community.uuid, expanded);
},
children: hasChildren
@ -213,15 +202,10 @@ class _SidebarWidgetState extends State<SidebarWidget> {
Widget _buildSpaceTile(SpaceModel space) {
bool isSelectedSpace =
_isSpaceOrChildSelected(space); // Check if space should be expanded
debugPrint(
'Building SpaceTile for ${space.name}, hasChildren: ${space.children.isNotEmpty}');
return SpaceTile(
title: space.name,
initiallyExpanded: isSelectedSpace,
onExpansionChanged: (bool expanded) {
debugPrint(
'SpaceTile onExpansionChanged called for ${space.name}, expanded: $expanded');
_handleExpansionChange(space.uuid, expanded);
},
children: space.children.isNotEmpty